import v2.0.0.0_RC3 | 2012-07-01
https://github.com/lucanos/CommunityID -> http://www.itadmins.net/archives/357
This commit is contained in:
@ -16,7 +16,7 @@
|
||||
* @package Zend_View
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Abstract.php 16541 2009-07-07 06:59:03Z bkarwin $
|
||||
* @version $Id: Abstract.php 19117 2009-11-20 17:44:14Z matthew $
|
||||
*/
|
||||
|
||||
/** Zend_Loader */
|
||||
@ -139,8 +139,6 @@ abstract class Zend_View_Abstract implements Zend_View_Interface
|
||||
*/
|
||||
private $_strictVars = false;
|
||||
|
||||
private $_log;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
@ -710,8 +708,8 @@ abstract class Zend_View_Abstract implements Zend_View_Interface
|
||||
|
||||
/**
|
||||
* Set LFI protection flag
|
||||
*
|
||||
* @param bool $flag
|
||||
*
|
||||
* @param bool $flag
|
||||
* @return Zend_View_Abstract
|
||||
*/
|
||||
public function setLfiProtection($flag)
|
||||
@ -722,7 +720,7 @@ abstract class Zend_View_Abstract implements Zend_View_Interface
|
||||
|
||||
/**
|
||||
* Return status of LFI protection flag
|
||||
*
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isLfiProtectionOn()
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Helper
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Abstract.php 16222 2009-06-21 19:55:20Z thomas $
|
||||
* @version $Id: Abstract.php 18951 2009-11-12 16:26:19Z alexander $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -40,7 +40,7 @@ abstract class Zend_View_Helper_Abstract implements Zend_View_Helper_Interface
|
||||
* @var Zend_View_Interface
|
||||
*/
|
||||
public $view = null;
|
||||
|
||||
|
||||
/**
|
||||
* Set the View object
|
||||
*
|
||||
|
@ -16,7 +16,7 @@
|
||||
* @package Zend_View
|
||||
* @subpackage Helper
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @version $Id: Action.php 16222 2009-06-21 19:55:20Z thomas $
|
||||
* @version $Id: Action.php 18951 2009-11-12 16:26:19Z alexander $
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
@ -31,7 +31,7 @@ require_once 'Zend/View/Helper/Abstract.php';
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_View_Helper_Action extends Zend_View_Helper_Abstract
|
||||
class Zend_View_Helper_Action extends Zend_View_Helper_Abstract
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
@ -52,25 +52,25 @@ class Zend_View_Helper_Action extends Zend_View_Helper_Abstract
|
||||
* @var Zend_Controller_Response_Abstract
|
||||
*/
|
||||
public $response;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* Grab local copies of various MVC objects
|
||||
*
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$front = Zend_Controller_Front::getInstance();
|
||||
$front = Zend_Controller_Front::getInstance();
|
||||
$modules = $front->getControllerDirectory();
|
||||
if (empty($modules)) {
|
||||
require_once 'Zend/View/Exception.php';
|
||||
throw new Zend_View_Exception('Action helper depends on valid front controller instance');
|
||||
}
|
||||
|
||||
$request = $front->getRequest();
|
||||
$response = $front->getResponse();
|
||||
$request = $front->getRequest();
|
||||
$response = $front->getResponse();
|
||||
|
||||
if (empty($request) || empty($response)) {
|
||||
require_once 'Zend/View/Exception.php';
|
||||
@ -79,73 +79,73 @@ class Zend_View_Helper_Action extends Zend_View_Helper_Abstract
|
||||
|
||||
$this->request = clone $request;
|
||||
$this->response = clone $response;
|
||||
$this->dispatcher = clone $front->getDispatcher();
|
||||
$this->dispatcher = clone $front->getDispatcher();
|
||||
$this->defaultModule = $front->getDefaultModule();
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset object states
|
||||
*
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function resetObjects()
|
||||
{
|
||||
$params = $this->request->getUserParams();
|
||||
foreach (array_keys($params) as $key) {
|
||||
$this->request->setParam($key, null);
|
||||
}
|
||||
|
||||
public function resetObjects()
|
||||
{
|
||||
$params = $this->request->getUserParams();
|
||||
foreach (array_keys($params) as $key) {
|
||||
$this->request->setParam($key, null);
|
||||
}
|
||||
|
||||
$this->response->clearBody();
|
||||
$this->response->clearHeaders()
|
||||
->clearRawHeaders();
|
||||
$this->response->clearHeaders()
|
||||
->clearRawHeaders();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve rendered contents of a controller action
|
||||
*
|
||||
* If the action results in a forward or redirect, returns empty string.
|
||||
*
|
||||
* @param string $action
|
||||
* @param string $controller
|
||||
*
|
||||
* @param string $action
|
||||
* @param string $controller
|
||||
* @param string $module Defaults to default module
|
||||
* @param array $params
|
||||
* @param array $params
|
||||
* @return string
|
||||
*/
|
||||
public function action($action, $controller, $module = null, array $params = array())
|
||||
{
|
||||
$this->resetObjects();
|
||||
if (null === $module) {
|
||||
$module = $this->defaultModule;
|
||||
}
|
||||
$this->resetObjects();
|
||||
if (null === $module) {
|
||||
$module = $this->defaultModule;
|
||||
}
|
||||
|
||||
// clone the view object to prevent over-writing of view variables
|
||||
$viewRendererObj = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
|
||||
Zend_Controller_Action_HelperBroker::addHelper(clone $viewRendererObj);
|
||||
|
||||
$this->request->setParams($params)
|
||||
->setModuleName($module)
|
||||
->setControllerName($controller)
|
||||
->setActionName($action)
|
||||
->setDispatched(true);
|
||||
|
||||
$this->dispatcher->dispatch($this->request, $this->response);
|
||||
|
||||
Zend_Controller_Action_HelperBroker::addHelper(clone $viewRendererObj);
|
||||
|
||||
$this->request->setParams($params)
|
||||
->setModuleName($module)
|
||||
->setControllerName($controller)
|
||||
->setActionName($action)
|
||||
->setDispatched(true);
|
||||
|
||||
$this->dispatcher->dispatch($this->request, $this->response);
|
||||
|
||||
// reset the viewRenderer object to it's original state
|
||||
Zend_Controller_Action_HelperBroker::addHelper($viewRendererObj);
|
||||
|
||||
|
||||
if (!$this->request->isDispatched()
|
||||
|| $this->response->isRedirect())
|
||||
{
|
||||
// forwards and redirects render nothing
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
if (!$this->request->isDispatched()
|
||||
|| $this->response->isRedirect())
|
||||
{
|
||||
// forwards and redirects render nothing
|
||||
return '';
|
||||
}
|
||||
|
||||
$return = $this->response->getBody();
|
||||
$this->resetObjects();
|
||||
$this->resetObjects();
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Clone the current View
|
||||
*
|
||||
|
@ -16,7 +16,7 @@
|
||||
* @package Zend_View
|
||||
* @subpackage Helper
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @version $Id: Fieldset.php 16222 2009-06-21 19:55:20Z thomas $
|
||||
* @version $Id: Fieldset.php 18951 2009-11-12 16:26:19Z alexander $
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
@ -51,7 +51,7 @@ class Zend_View_Helper_Fieldset extends Zend_View_Helper_FormElement
|
||||
if (isset($attribs['legend'])) {
|
||||
$legendString = trim($attribs['legend']);
|
||||
if (!empty($legendString)) {
|
||||
$legend = '<legend>'
|
||||
$legend = '<legend>'
|
||||
. (($escape) ? $this->view->escape($legendString) : $legendString)
|
||||
. '</legend>' . PHP_EOL;
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Helper
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: FormCheckbox.php 17716 2009-08-21 15:08:31Z matthew $
|
||||
* @version $Id: FormCheckbox.php 18951 2009-11-12 16:26:19Z alexander $
|
||||
*/
|
||||
|
||||
|
||||
@ -89,7 +89,7 @@ class Zend_View_Helper_FormCheckbox extends Zend_View_Helper_FormElement
|
||||
|
||||
// build the element
|
||||
$xhtml = '';
|
||||
if (!strstr($name, '[]')) {
|
||||
if (!$disable && !strstr($name, '[]')) {
|
||||
$xhtml = $this->_hidden($name, $checkedOptions['uncheckedValue']);
|
||||
}
|
||||
$xhtml .= '<input type="checkbox"'
|
||||
@ -106,10 +106,10 @@ class Zend_View_Helper_FormCheckbox extends Zend_View_Helper_FormElement
|
||||
|
||||
/**
|
||||
* Determine checkbox information
|
||||
*
|
||||
* @param string $value
|
||||
* @param bool $checked
|
||||
* @param array|null $checkedOptions
|
||||
*
|
||||
* @param string $value
|
||||
* @param bool $checked
|
||||
* @param array|null $checkedOptions
|
||||
* @return array
|
||||
*/
|
||||
public static function determineCheckboxInfo($value, $checked, array $checkedOptions = null)
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Helper
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: FormFile.php 16541 2009-07-07 06:59:03Z bkarwin $
|
||||
* @version $Id: FormFile.php 18951 2009-11-12 16:26:19Z alexander $
|
||||
*/
|
||||
|
||||
|
||||
@ -60,7 +60,7 @@ class Zend_View_Helper_FormFile extends Zend_View_Helper_FormElement
|
||||
$disabled = '';
|
||||
if ($disable) {
|
||||
$disabled = ' disabled="disabled"';
|
||||
}
|
||||
}
|
||||
|
||||
// XHTML or HTML end tag?
|
||||
$endTag = ' />';
|
||||
@ -73,7 +73,7 @@ class Zend_View_Helper_FormFile extends Zend_View_Helper_FormElement
|
||||
. ' name="' . $this->view->escape($name) . '"'
|
||||
. ' id="' . $this->view->escape($id) . '"'
|
||||
. $disabled
|
||||
. $this->_htmlAttribs($attribs)
|
||||
. $this->_htmlAttribs($attribs)
|
||||
. $endTag;
|
||||
|
||||
return $xhtml;
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Helper
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: FormImage.php 16541 2009-07-07 06:59:03Z bkarwin $
|
||||
* @version $Id: FormImage.php 18951 2009-11-12 16:26:19Z alexander $
|
||||
*/
|
||||
|
||||
|
||||
@ -79,7 +79,7 @@ class Zend_View_Helper_FormImage extends Zend_View_Helper_FormElement
|
||||
if ($disable) {
|
||||
$disabled = ' disabled="disabled"';
|
||||
}
|
||||
|
||||
|
||||
// XHTML or HTML end tag?
|
||||
$endTag = ' />';
|
||||
if (($this->view instanceof Zend_View_Abstract) && !$this->view->doctype()->isXhtml()) {
|
||||
@ -93,7 +93,7 @@ class Zend_View_Helper_FormImage extends Zend_View_Helper_FormElement
|
||||
. $src
|
||||
. $value
|
||||
. $disabled
|
||||
. $this->_htmlAttribs($attribs)
|
||||
. $this->_htmlAttribs($attribs)
|
||||
. $endTag;
|
||||
|
||||
return $xhtml;
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Helper
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: FormLabel.php 16541 2009-07-07 06:59:03Z bkarwin $
|
||||
* @version $Id: FormLabel.php 19128 2009-11-20 19:19:29Z matthew $
|
||||
*/
|
||||
|
||||
/** Zend_View_Helper_FormElement **/
|
||||
@ -50,17 +50,23 @@ class Zend_View_Helper_FormLabel extends Zend_View_Helper_FormElement
|
||||
// build the element
|
||||
if ($disable) {
|
||||
// disabled; display nothing
|
||||
$xhtml = '';
|
||||
} else {
|
||||
$value = ($escape) ? $this->view->escape($value) : $value;
|
||||
|
||||
// enabled; display label
|
||||
$xhtml = '<label'
|
||||
. ' for="' . $this->view->escape($id) . '"'
|
||||
. $this->_htmlAttribs($attribs)
|
||||
. '>' . $value . '</label>';
|
||||
return '';
|
||||
}
|
||||
|
||||
$value = ($escape) ? $this->view->escape($value) : $value;
|
||||
$for = (empty($attribs['disableFor']) || !$attribs['disableFor'])
|
||||
? ' for="' . $this->view->escape($id) . '"'
|
||||
: '';
|
||||
if (array_key_exists('disableFor', $attribs)) {
|
||||
unset($attribs['disableFor']);
|
||||
}
|
||||
|
||||
// enabled; display label
|
||||
$xhtml = '<label'
|
||||
. $for
|
||||
. $this->_htmlAttribs($attribs)
|
||||
. '>' . $value . '</label>';
|
||||
|
||||
return $xhtml;
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Helper
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: FormPassword.php 16541 2009-07-07 06:59:03Z bkarwin $
|
||||
* @version $Id: FormPassword.php 18951 2009-11-12 16:26:19Z alexander $
|
||||
*/
|
||||
|
||||
|
||||
@ -73,7 +73,7 @@ class Zend_View_Helper_FormPassword extends Zend_View_Helper_FormElement
|
||||
}
|
||||
unset($attribs['renderPassword']);
|
||||
}
|
||||
|
||||
|
||||
// XHTML or HTML end tag?
|
||||
$endTag = ' />';
|
||||
if (($this->view instanceof Zend_View_Abstract) && !$this->view->doctype()->isXhtml()) {
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Helper
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: FormSelect.php 16541 2009-07-07 06:59:03Z bkarwin $
|
||||
* @version $Id: FormSelect.php 18951 2009-11-12 16:26:19Z alexander $
|
||||
*/
|
||||
|
||||
|
||||
@ -67,7 +67,7 @@ class Zend_View_Helper_FormSelect extends Zend_View_Helper_FormElement
|
||||
$info = $this->_getInfo($name, $value, $attribs, $options, $listsep);
|
||||
extract($info); // name, id, value, attribs, options, listsep, disable
|
||||
|
||||
// force $value to array so we can compare multiple values to multiple
|
||||
// force $value to array so we can compare multiple values to multiple
|
||||
// options; also ensure it's a string for comparison purposes.
|
||||
$value = array_map('strval', (array) $value);
|
||||
|
||||
@ -94,7 +94,7 @@ class Zend_View_Helper_FormSelect extends Zend_View_Helper_FormElement
|
||||
$multiple = '';
|
||||
}
|
||||
unset($attribs['multiple']);
|
||||
}
|
||||
}
|
||||
|
||||
// now start building the XHTML.
|
||||
$disabled = '';
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Helper
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: FormSubmit.php 16541 2009-07-07 06:59:03Z bkarwin $
|
||||
* @version $Id: FormSubmit.php 18951 2009-11-12 16:26:19Z alexander $
|
||||
*/
|
||||
|
||||
|
||||
@ -76,7 +76,7 @@ class Zend_View_Helper_FormSubmit extends Zend_View_Helper_FormElement
|
||||
. ' id="' . $this->view->escape($id) . '"'
|
||||
. ' value="' . $this->view->escape($value) . '"'
|
||||
. $disabled
|
||||
. $this->_htmlAttribs($attribs)
|
||||
. $this->_htmlAttribs($attribs)
|
||||
. $endTag;
|
||||
|
||||
return $xhtml;
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Helper
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: FormText.php 16541 2009-07-07 06:59:03Z bkarwin $
|
||||
* @version $Id: FormText.php 18951 2009-11-12 16:26:19Z alexander $
|
||||
*/
|
||||
|
||||
|
||||
@ -64,7 +64,7 @@ class Zend_View_Helper_FormText extends Zend_View_Helper_FormElement
|
||||
// disabled
|
||||
$disabled = ' disabled="disabled"';
|
||||
}
|
||||
|
||||
|
||||
// XHTML or HTML end tag?
|
||||
$endTag = ' />';
|
||||
if (($this->view instanceof Zend_View_Abstract) && !$this->view->doctype()->isXhtml()) {
|
||||
|
@ -16,7 +16,7 @@
|
||||
* @package Zend_View
|
||||
* @subpackage Helper
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @version $Id: HeadStyle.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
* @version $Id: HeadStyle.php 18572 2009-10-16 13:37:08Z sgehrig $
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
@ -324,6 +324,7 @@ class Zend_View_Helper_HeadStyle extends Zend_View_Helper_Placeholder_Container_
|
||||
$media_types = explode(',', $value);
|
||||
$value = '';
|
||||
foreach($media_types as $type) {
|
||||
$type = trim($type);
|
||||
if (!in_array($type, $this->_mediaTypes)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -16,7 +16,7 @@
|
||||
* @package Zend_View
|
||||
* @subpackage Helper
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @version $Id: HeadTitle.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
* @version $Id: HeadTitle.php 18951 2009-11-12 16:26:19Z alexander $
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
@ -63,7 +63,8 @@ class Zend_View_Helper_HeadTitle extends Zend_View_Helper_Placeholder_Container_
|
||||
*/
|
||||
public function headTitle($title = null, $setType = Zend_View_Helper_Placeholder_Container_Abstract::APPEND)
|
||||
{
|
||||
if ($title) {
|
||||
$title = (string) $title;
|
||||
if ($title !== '') {
|
||||
if ($setType == Zend_View_Helper_Placeholder_Container_Abstract::SET) {
|
||||
$this->set($title);
|
||||
} elseif ($setType == Zend_View_Helper_Placeholder_Container_Abstract::PREPEND) {
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Helper
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: HtmlElement.php 16222 2009-06-21 19:55:20Z thomas $
|
||||
* @version $Id: HtmlElement.php 18951 2009-11-12 16:26:19Z alexander $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -115,15 +115,15 @@ abstract class Zend_View_Helper_HtmlElement extends Zend_View_Helper_Abstract
|
||||
} else {
|
||||
$xhtml .= " $key=\"$val\"";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return $xhtml;
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalize an ID
|
||||
*
|
||||
* @param string $value
|
||||
*
|
||||
* @param string $value
|
||||
* @return string
|
||||
*/
|
||||
protected function _normalizeId($value)
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Helper
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: HtmlFlash.php 16222 2009-06-21 19:55:20Z thomas $
|
||||
* @version $Id: HtmlFlash.php 18951 2009-11-12 16:26:19Z alexander $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -39,7 +39,7 @@ class Zend_View_Helper_HtmlFlash extends Zend_View_Helper_HtmlObject
|
||||
*
|
||||
*/
|
||||
const TYPE = 'application/x-shockwave-flash';
|
||||
|
||||
|
||||
/**
|
||||
* Output a flash movie object tag
|
||||
*
|
||||
|
@ -16,7 +16,7 @@
|
||||
* @package Zend_View
|
||||
* @subpackage Helper
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @version $Id: InlineScript.php 16541 2009-07-07 06:59:03Z bkarwin $
|
||||
* @version $Id: InlineScript.php 18951 2009-11-12 16:26:19Z alexander $
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
require_once 'Zend/View/Helper/HeadScript.php';
|
||||
|
||||
/**
|
||||
* Helper for setting and retrieving script elements for inclusion in HTML body
|
||||
* Helper for setting and retrieving script elements for inclusion in HTML body
|
||||
* section
|
||||
*
|
||||
* @uses Zend_View_Helper_Head_Script
|
||||
@ -44,7 +44,7 @@ class Zend_View_Helper_InlineScript extends Zend_View_Helper_HeadScript
|
||||
/**
|
||||
* Return InlineScript object
|
||||
*
|
||||
* Returns InlineScript helper object; optionally, allows specifying a
|
||||
* Returns InlineScript helper object; optionally, allows specifying a
|
||||
* script or script file to include.
|
||||
*
|
||||
* @param string $mode Script or file
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Helper
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Interface.php 16222 2009-06-21 19:55:20Z thomas $
|
||||
* @version $Id: Interface.php 18951 2009-11-12 16:26:19Z alexander $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -39,7 +39,7 @@ interface Zend_View_Helper_Interface
|
||||
|
||||
/**
|
||||
* Strategy pattern: helper method to invoke
|
||||
*
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function direct();
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Helper
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Helper.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
* @version $Id: Helper.php 18951 2009-11-12 16:26:19Z alexander $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -126,7 +126,7 @@ interface Zend_View_Helper_Navigation_Helper
|
||||
* @return bool whether ACL should be used
|
||||
*/
|
||||
public function getUseAcl();
|
||||
|
||||
|
||||
/**
|
||||
* Return renderInvisible flag
|
||||
*
|
||||
|
@ -16,7 +16,7 @@
|
||||
* @package Zend_View
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: PaginationControl.php 16222 2009-06-21 19:55:20Z thomas $
|
||||
* @version $Id: PaginationControl.php 18951 2009-11-12 16:26:19Z alexander $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -29,7 +29,7 @@ class Zend_View_Helper_PaginationControl
|
||||
{
|
||||
/**
|
||||
* View instance
|
||||
*
|
||||
*
|
||||
* @var Zend_View_Instance
|
||||
*/
|
||||
public $view = null;
|
||||
@ -62,7 +62,7 @@ class Zend_View_Helper_PaginationControl
|
||||
{
|
||||
self::$_defaultViewPartial = $partial;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the default view partial
|
||||
*
|
||||
@ -75,7 +75,7 @@ class Zend_View_Helper_PaginationControl
|
||||
|
||||
/**
|
||||
* Render the provided pages. This checks if $view->paginator is set and,
|
||||
* if so, uses that. Also, if no scrolling style or partial are specified,
|
||||
* if so, uses that. Also, if no scrolling style or partial are specified,
|
||||
* the defaults will be used (if set).
|
||||
*
|
||||
* @param Zend_Paginator (Optional) $paginator
|
||||
@ -99,7 +99,7 @@ class Zend_View_Helper_PaginationControl
|
||||
throw new Zend_View_Exception('No paginator instance provided or incorrect type');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($partial === null) {
|
||||
if (self::$_defaultViewPartial === null) {
|
||||
/**
|
||||
@ -109,12 +109,12 @@ class Zend_View_Helper_PaginationControl
|
||||
|
||||
throw new Zend_View_Exception('No view partial provided and no default set');
|
||||
}
|
||||
|
||||
|
||||
$partial = self::$_defaultViewPartial;
|
||||
}
|
||||
|
||||
$pages = get_object_vars($paginator->getPages($scrollingStyle));
|
||||
|
||||
|
||||
if ($params !== null) {
|
||||
$pages = array_merge($pages, (array) $params);
|
||||
}
|
||||
@ -132,10 +132,10 @@ class Zend_View_Helper_PaginationControl
|
||||
if ($partial[1] !== null) {
|
||||
return $this->view->partial($partial[0], $partial[1], $pages);
|
||||
}
|
||||
|
||||
|
||||
$partial = $partial[0];
|
||||
}
|
||||
|
||||
|
||||
return $this->view->partial($partial, $pages);
|
||||
}
|
||||
}
|
@ -16,7 +16,7 @@
|
||||
* @package Zend_View
|
||||
* @subpackage Helper
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @version $Id: Placeholder.php 16541 2009-07-07 06:59:03Z bkarwin $
|
||||
* @version $Id: Placeholder.php 18951 2009-11-12 16:26:19Z alexander $
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
@ -36,14 +36,14 @@ require_once 'Zend/View/Helper/Abstract.php';
|
||||
* @subpackage Helper
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
*/
|
||||
class Zend_View_Helper_Placeholder extends Zend_View_Helper_Abstract
|
||||
{
|
||||
{
|
||||
/**
|
||||
* Placeholder items
|
||||
* @var array
|
||||
*/
|
||||
protected $_items = array();
|
||||
*/
|
||||
protected $_items = array();
|
||||
|
||||
/**
|
||||
* @var Zend_View_Helper_Placeholder_Registry
|
||||
@ -54,30 +54,30 @@ class Zend_View_Helper_Placeholder extends Zend_View_Helper_Abstract
|
||||
* Constructor
|
||||
*
|
||||
* Retrieve container registry from Zend_Registry, or create new one and register it.
|
||||
*
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->_registry = Zend_View_Helper_Placeholder_Registry::getRegistry();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Placeholder helper
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @param string $name
|
||||
* @return Zend_View_Helper_Placeholder_Container_Abstract
|
||||
*/
|
||||
public function placeholder($name)
|
||||
{
|
||||
$name = (string) $name;
|
||||
*/
|
||||
public function placeholder($name)
|
||||
{
|
||||
$name = (string) $name;
|
||||
return $this->_registry->getContainer($name);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the registry
|
||||
*
|
||||
*
|
||||
* @return Zend_View_Helper_Placeholder_Registry
|
||||
*/
|
||||
public function getRegistry()
|
||||
|
@ -16,7 +16,7 @@
|
||||
* @package Zend_View
|
||||
* @subpackage Helper
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @version $Id: Container.php 16541 2009-07-07 06:59:03Z bkarwin $
|
||||
* @version $Id: Container.php 18951 2009-11-12 16:26:19Z alexander $
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
@ -30,7 +30,7 @@ require_once 'Zend/View/Helper/Placeholder/Container/Abstract.php';
|
||||
* @subpackage Helper
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
*/
|
||||
class Zend_View_Helper_Placeholder_Container extends Zend_View_Helper_Placeholder_Container_Abstract
|
||||
{
|
||||
{
|
||||
}
|
||||
|
@ -16,7 +16,7 @@
|
||||
* @package Zend_View
|
||||
* @subpackage Helper
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @version $Id: Abstract.php 16541 2009-07-07 06:59:03Z bkarwin $
|
||||
* @version $Id: Abstract.php 18951 2009-11-12 16:26:19Z alexander $
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
@ -71,7 +71,7 @@ abstract class Zend_View_Helper_Placeholder_Container_Abstract extends ArrayObje
|
||||
* @var string
|
||||
*/
|
||||
protected $_indent = '';
|
||||
|
||||
|
||||
/**
|
||||
* Whether or not we're already capturing for this given container
|
||||
* @var bool
|
||||
@ -89,7 +89,7 @@ abstract class Zend_View_Helper_Placeholder_Container_Abstract extends ArrayObje
|
||||
* @var string
|
||||
*/
|
||||
protected $_captureKey;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor - This is needed so that we can attach a class member as the ArrayObject container
|
||||
*
|
||||
@ -99,7 +99,7 @@ abstract class Zend_View_Helper_Placeholder_Container_Abstract extends ArrayObje
|
||||
{
|
||||
parent::__construct(array(), parent::ARRAY_AS_PROPS);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set a single value
|
||||
*
|
||||
@ -113,8 +113,8 @@ abstract class Zend_View_Helper_Placeholder_Container_Abstract extends ArrayObje
|
||||
|
||||
/**
|
||||
* Prepend a value to the top of the container
|
||||
*
|
||||
* @param mixed $value
|
||||
*
|
||||
* @param mixed $value
|
||||
* @return void
|
||||
*/
|
||||
public function prepend($value)
|
||||
@ -236,8 +236,8 @@ abstract class Zend_View_Helper_Placeholder_Container_Abstract extends ArrayObje
|
||||
|
||||
/**
|
||||
* Retrieve whitespace representation of $indent
|
||||
*
|
||||
* @param int|string $indent
|
||||
*
|
||||
* @param int|string $indent
|
||||
* @return string
|
||||
*/
|
||||
public function getWhitespace($indent)
|
||||
@ -248,7 +248,7 @@ abstract class Zend_View_Helper_Placeholder_Container_Abstract extends ArrayObje
|
||||
|
||||
return (string) $indent;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Start capturing content to push into placeholder
|
||||
*
|
||||
@ -305,10 +305,10 @@ abstract class Zend_View_Helper_Placeholder_Container_Abstract extends ArrayObje
|
||||
case self::APPEND:
|
||||
default:
|
||||
if (null !== $key) {
|
||||
if (empty($this[$key])) {
|
||||
$this[$key] = $data;
|
||||
} else {
|
||||
$this[$key] .= $data;
|
||||
if (empty($this[$key])) {
|
||||
$this[$key] = $data;
|
||||
} else {
|
||||
$this[$key] .= $data;
|
||||
}
|
||||
} else {
|
||||
$this[$this->nextIndex()] = $data;
|
||||
@ -319,7 +319,7 @@ abstract class Zend_View_Helper_Placeholder_Container_Abstract extends ArrayObje
|
||||
|
||||
/**
|
||||
* Get keys
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getKeys()
|
||||
@ -343,7 +343,7 @@ abstract class Zend_View_Helper_Placeholder_Container_Abstract extends ArrayObje
|
||||
|
||||
return $nextIndex = max($keys) + 1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Render the placeholder
|
||||
*
|
||||
@ -351,12 +351,12 @@ abstract class Zend_View_Helper_Placeholder_Container_Abstract extends ArrayObje
|
||||
*/
|
||||
public function toString($indent = null)
|
||||
{
|
||||
$indent = ($indent !== null)
|
||||
? $this->getWhitespace($indent)
|
||||
$indent = ($indent !== null)
|
||||
? $this->getWhitespace($indent)
|
||||
: $this->getIndent();
|
||||
|
||||
|
||||
$items = $this->getArrayCopy();
|
||||
$return = $indent
|
||||
$return = $indent
|
||||
. $this->getPrefix()
|
||||
. implode($this->getSeparator(), $items)
|
||||
. $this->getPostfix();
|
||||
|
@ -16,7 +16,7 @@
|
||||
* @package Zend_View
|
||||
* @subpackage Helper
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @version $Id: Standalone.php 16541 2009-07-07 06:59:03Z bkarwin $
|
||||
* @version $Id: Standalone.php 18951 2009-11-12 16:26:19Z alexander $
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
@ -33,9 +33,9 @@ require_once 'Zend/View/Helper/Abstract.php';
|
||||
* @subpackage Helper
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
*/
|
||||
abstract class Zend_View_Helper_Placeholder_Container_Standalone extends Zend_View_Helper_Abstract implements IteratorAggregate, Countable, ArrayAccess
|
||||
{
|
||||
{
|
||||
/**
|
||||
* @var Zend_View_Helper_Placeholder_Container_Abstract
|
||||
*/
|
||||
@ -61,7 +61,7 @@ abstract class Zend_View_Helper_Placeholder_Container_Standalone extends Zend_Vi
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
@ -72,7 +72,7 @@ abstract class Zend_View_Helper_Placeholder_Container_Standalone extends Zend_Vi
|
||||
|
||||
/**
|
||||
* Retrieve registry
|
||||
*
|
||||
*
|
||||
* @return Zend_View_Helper_Placeholder_Registry
|
||||
*/
|
||||
public function getRegistry()
|
||||
@ -81,9 +81,9 @@ abstract class Zend_View_Helper_Placeholder_Container_Standalone extends Zend_Vi
|
||||
}
|
||||
|
||||
/**
|
||||
* Set registry object
|
||||
*
|
||||
* @param Zend_View_Helper_Placeholder_Registry $registry
|
||||
* Set registry object
|
||||
*
|
||||
* @param Zend_View_Helper_Placeholder_Registry $registry
|
||||
* @return Zend_View_Helper_Placeholder_Container_Standalone
|
||||
*/
|
||||
public function setRegistry(Zend_View_Helper_Placeholder_Registry $registry)
|
||||
@ -94,7 +94,7 @@ abstract class Zend_View_Helper_Placeholder_Container_Standalone extends Zend_Vi
|
||||
|
||||
/**
|
||||
* Set whether or not auto escaping should be used
|
||||
*
|
||||
*
|
||||
* @param bool $autoEscape whether or not to auto escape output
|
||||
* @return Zend_View_Helper_Placeholder_Container_Standalone
|
||||
*/
|
||||
@ -103,7 +103,7 @@ abstract class Zend_View_Helper_Placeholder_Container_Standalone extends Zend_Vi
|
||||
$this->_autoEscape = ($autoEscape) ? true : false;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return whether autoEscaping is enabled or disabled
|
||||
*
|
||||
@ -116,8 +116,8 @@ abstract class Zend_View_Helper_Placeholder_Container_Standalone extends Zend_Vi
|
||||
|
||||
/**
|
||||
* Escape a string
|
||||
*
|
||||
* @param string $string
|
||||
*
|
||||
* @param string $string
|
||||
* @return string
|
||||
*/
|
||||
protected function _escape($string)
|
||||
@ -131,8 +131,8 @@ abstract class Zend_View_Helper_Placeholder_Container_Standalone extends Zend_Vi
|
||||
|
||||
/**
|
||||
* Set container on which to operate
|
||||
*
|
||||
* @param Zend_View_Helper_Placeholder_Container_Abstract $container
|
||||
*
|
||||
* @param Zend_View_Helper_Placeholder_Container_Abstract $container
|
||||
* @return Zend_View_Helper_Placeholder_Container_Standalone
|
||||
*/
|
||||
public function setContainer(Zend_View_Helper_Placeholder_Container_Abstract $container)
|
||||
@ -143,7 +143,7 @@ abstract class Zend_View_Helper_Placeholder_Container_Standalone extends Zend_Vi
|
||||
|
||||
/**
|
||||
* Retrieve placeholder container
|
||||
*
|
||||
*
|
||||
* @return Zend_View_Helper_Placeholder_Container_Abstract
|
||||
*/
|
||||
public function getContainer()
|
||||
@ -153,9 +153,9 @@ abstract class Zend_View_Helper_Placeholder_Container_Standalone extends Zend_Vi
|
||||
|
||||
/**
|
||||
* Overloading: set property value
|
||||
*
|
||||
* @param string $key
|
||||
* @param mixed $value
|
||||
*
|
||||
* @param string $key
|
||||
* @param mixed $value
|
||||
* @return void
|
||||
*/
|
||||
public function __set($key, $value)
|
||||
@ -166,8 +166,8 @@ abstract class Zend_View_Helper_Placeholder_Container_Standalone extends Zend_Vi
|
||||
|
||||
/**
|
||||
* Overloading: retrieve property
|
||||
*
|
||||
* @param string $key
|
||||
*
|
||||
* @param string $key
|
||||
* @return mixed
|
||||
*/
|
||||
public function __get($key)
|
||||
@ -182,8 +182,8 @@ abstract class Zend_View_Helper_Placeholder_Container_Standalone extends Zend_Vi
|
||||
|
||||
/**
|
||||
* Overloading: check if property is set
|
||||
*
|
||||
* @param string $key
|
||||
*
|
||||
* @param string $key
|
||||
* @return bool
|
||||
*/
|
||||
public function __isset($key)
|
||||
@ -194,8 +194,8 @@ abstract class Zend_View_Helper_Placeholder_Container_Standalone extends Zend_Vi
|
||||
|
||||
/**
|
||||
* Overloading: unset property
|
||||
*
|
||||
* @param string $key
|
||||
*
|
||||
* @param string $key
|
||||
* @return void
|
||||
*/
|
||||
public function __unset($key)
|
||||
@ -210,9 +210,9 @@ abstract class Zend_View_Helper_Placeholder_Container_Standalone extends Zend_Vi
|
||||
* Overload
|
||||
*
|
||||
* Proxy to container methods
|
||||
*
|
||||
* @param string $method
|
||||
* @param array $args
|
||||
*
|
||||
* @param string $method
|
||||
* @param array $args
|
||||
* @return mixed
|
||||
*/
|
||||
public function __call($method, $args)
|
||||
@ -233,7 +233,7 @@ abstract class Zend_View_Helper_Placeholder_Container_Standalone extends Zend_Vi
|
||||
|
||||
/**
|
||||
* String representation
|
||||
*
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
@ -243,7 +243,7 @@ abstract class Zend_View_Helper_Placeholder_Container_Standalone extends Zend_Vi
|
||||
|
||||
/**
|
||||
* Cast to string representation
|
||||
*
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
@ -253,7 +253,7 @@ abstract class Zend_View_Helper_Placeholder_Container_Standalone extends Zend_Vi
|
||||
|
||||
/**
|
||||
* Countable
|
||||
*
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function count()
|
||||
@ -264,8 +264,8 @@ abstract class Zend_View_Helper_Placeholder_Container_Standalone extends Zend_Vi
|
||||
|
||||
/**
|
||||
* ArrayAccess: offsetExists
|
||||
*
|
||||
* @param string|int $offset
|
||||
*
|
||||
* @param string|int $offset
|
||||
* @return bool
|
||||
*/
|
||||
public function offsetExists($offset)
|
||||
@ -275,8 +275,8 @@ abstract class Zend_View_Helper_Placeholder_Container_Standalone extends Zend_Vi
|
||||
|
||||
/**
|
||||
* ArrayAccess: offsetGet
|
||||
*
|
||||
* @param string|int $offset
|
||||
*
|
||||
* @param string|int $offset
|
||||
* @return mixed
|
||||
*/
|
||||
public function offsetGet($offset)
|
||||
@ -286,9 +286,9 @@ abstract class Zend_View_Helper_Placeholder_Container_Standalone extends Zend_Vi
|
||||
|
||||
/**
|
||||
* ArrayAccess: offsetSet
|
||||
*
|
||||
* @param string|int $offset
|
||||
* @param mixed $value
|
||||
*
|
||||
* @param string|int $offset
|
||||
* @param mixed $value
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value)
|
||||
@ -298,8 +298,8 @@ abstract class Zend_View_Helper_Placeholder_Container_Standalone extends Zend_Vi
|
||||
|
||||
/**
|
||||
* ArrayAccess: offsetUnset
|
||||
*
|
||||
* @param string|int $offset
|
||||
*
|
||||
* @param string|int $offset
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset)
|
||||
@ -309,7 +309,7 @@ abstract class Zend_View_Helper_Placeholder_Container_Standalone extends Zend_Vi
|
||||
|
||||
/**
|
||||
* IteratorAggregate: get Iterator
|
||||
*
|
||||
*
|
||||
* @return Iterator
|
||||
*/
|
||||
public function getIterator()
|
||||
|
@ -16,7 +16,7 @@
|
||||
* @package Zend_View
|
||||
* @subpackage Helper
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @version $Id: Registry.php 16541 2009-07-07 06:59:03Z bkarwin $
|
||||
* @version $Id: Registry.php 18951 2009-11-12 16:26:19Z alexander $
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
@ -36,7 +36,7 @@ require_once 'Zend/View/Helper/Placeholder/Container.php';
|
||||
* @subpackage Helper
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
*/
|
||||
class Zend_View_Helper_Placeholder_Registry
|
||||
{
|
||||
/**
|
||||
@ -59,7 +59,7 @@ class Zend_View_Helper_Placeholder_Registry
|
||||
|
||||
/**
|
||||
* Retrieve or create registry instnace
|
||||
*
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function getRegistry()
|
||||
@ -75,10 +75,10 @@ class Zend_View_Helper_Placeholder_Registry
|
||||
}
|
||||
|
||||
/**
|
||||
* createContainer
|
||||
*
|
||||
* @param string $key
|
||||
* @param array $value
|
||||
* createContainer
|
||||
*
|
||||
* @param string $key
|
||||
* @param array $value
|
||||
* @return Zend_View_Helper_Placeholder_Container_Abstract
|
||||
*/
|
||||
public function createContainer($key, array $value = array())
|
||||
@ -91,8 +91,8 @@ class Zend_View_Helper_Placeholder_Registry
|
||||
|
||||
/**
|
||||
* Retrieve a placeholder container
|
||||
*
|
||||
* @param string $key
|
||||
*
|
||||
* @param string $key
|
||||
* @return Zend_View_Helper_Placeholder_Container_Abstract
|
||||
*/
|
||||
public function getContainer($key)
|
||||
@ -109,8 +109,8 @@ class Zend_View_Helper_Placeholder_Registry
|
||||
|
||||
/**
|
||||
* Does a particular container exist?
|
||||
*
|
||||
* @param string $key
|
||||
*
|
||||
* @param string $key
|
||||
* @return bool
|
||||
*/
|
||||
public function containerExists($key)
|
||||
@ -122,9 +122,9 @@ class Zend_View_Helper_Placeholder_Registry
|
||||
|
||||
/**
|
||||
* Set the container for an item in the registry
|
||||
*
|
||||
* @param string $key
|
||||
* @param Zend_View_Placeholder_Container_Abstract $container
|
||||
*
|
||||
* @param string $key
|
||||
* @param Zend_View_Placeholder_Container_Abstract $container
|
||||
* @return Zend_View_Placeholder_Registry
|
||||
*/
|
||||
public function setContainer($key, Zend_View_Helper_Placeholder_Container_Abstract $container)
|
||||
@ -136,8 +136,8 @@ class Zend_View_Helper_Placeholder_Registry
|
||||
|
||||
/**
|
||||
* Delete a container
|
||||
*
|
||||
* @param string $key
|
||||
*
|
||||
* @param string $key
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteContainer($key)
|
||||
@ -153,8 +153,8 @@ class Zend_View_Helper_Placeholder_Registry
|
||||
|
||||
/**
|
||||
* Set the container class to use
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @param string $name
|
||||
* @return Zend_View_Helper_Placeholder_Registry
|
||||
*/
|
||||
public function setContainerClass($name)
|
||||
@ -176,7 +176,7 @@ class Zend_View_Helper_Placeholder_Registry
|
||||
|
||||
/**
|
||||
* Retrieve the container class
|
||||
*
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getContainerClass()
|
||||
|
@ -16,7 +16,7 @@
|
||||
* @package Zend_View
|
||||
* @subpackage Helper
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @version $Id: RenderToPlaceholder.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
* @version $Id: RenderToPlaceholder.php 18209 2009-09-17 22:36:12Z padraic $
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
require_once 'Zend/View/Helper/Abstract.php';
|
||||
|
||||
/**
|
||||
* Helper for making easy links and getting urls that depend on the routes and router
|
||||
* Renders a template and stores the rendered output as a placeholder
|
||||
* variable for later use.
|
||||
*
|
||||
* @package Zend_View
|
||||
* @subpackage Helper
|
||||
@ -35,6 +36,14 @@ require_once 'Zend/View/Helper/Abstract.php';
|
||||
class Zend_View_Helper_RenderToPlaceholder extends Zend_View_Helper_Abstract
|
||||
{
|
||||
|
||||
/**
|
||||
* Renders a template and stores the rendered output as a placeholder
|
||||
* variable for later use.
|
||||
*
|
||||
* @param $script The template script to render
|
||||
* @param $placeholder The placeholder variable name in which to store the rendered output
|
||||
* @return void
|
||||
*/
|
||||
public function renderToPlaceholder($script, $placeholder)
|
||||
{
|
||||
$this->view->placeholder($placeholder)->captureStart();
|
||||
|
@ -17,7 +17,7 @@
|
||||
* @subpackage Helper
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Translate.php 16222 2009-06-21 19:55:20Z thomas $
|
||||
* @version $Id: Translate.php 19122 2009-11-20 18:06:37Z matthew $
|
||||
*/
|
||||
|
||||
/** Zend_Locale */
|
||||
@ -50,7 +50,7 @@ class Zend_View_Helper_Translate extends Zend_View_Helper_Abstract
|
||||
*/
|
||||
public function __construct($translate = null)
|
||||
{
|
||||
if (empty($translate) === false) {
|
||||
if ($translate !== null) {
|
||||
$this->setTranslator($translate);
|
||||
}
|
||||
}
|
||||
@ -132,7 +132,7 @@ class Zend_View_Helper_Translate extends Zend_View_Helper_Abstract
|
||||
{
|
||||
if ($this->_translator === null) {
|
||||
require_once 'Zend/Registry.php';
|
||||
if (Zend_Registry::isRegistered('Zend_Translate') === true) {
|
||||
if (Zend_Registry::isRegistered('Zend_Translate')) {
|
||||
$this->setTranslator(Zend_Registry::get('Zend_Translate'));
|
||||
}
|
||||
}
|
||||
|
@ -16,20 +16,20 @@
|
||||
* @package Zend_View
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Stream.php 16541 2009-07-07 06:59:03Z bkarwin $
|
||||
* @version $Id: Stream.php 18951 2009-11-12 16:26:19Z alexander $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Stream wrapper to convert markup of mostly-PHP templates into PHP prior to
|
||||
* Stream wrapper to convert markup of mostly-PHP templates into PHP prior to
|
||||
* include().
|
||||
*
|
||||
*
|
||||
* Based in large part on the example at
|
||||
* http://www.php.net/manual/en/function.stream-wrapper-register.php
|
||||
*
|
||||
*
|
||||
* As well as the example provided at:
|
||||
* http://mikenaberezny.com/2006/02/19/symphony-templates-ruby-erb/
|
||||
* written by
|
||||
* Mike Naberezny (@link http://mikenaberezny.com)
|
||||
* written by
|
||||
* Mike Naberezny (@link http://mikenaberezny.com)
|
||||
* Paul M. Jones (@link http://paul-m-jones.com)
|
||||
*
|
||||
* @category Zend
|
||||
@ -37,7 +37,7 @@
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_View_Stream
|
||||
class Zend_View_Stream
|
||||
{
|
||||
/**
|
||||
* Current stream position.
|
||||
@ -59,16 +59,16 @@ class Zend_View_Stream
|
||||
* @var array
|
||||
*/
|
||||
protected $_stat;
|
||||
|
||||
|
||||
/**
|
||||
* Opens the script file and converts markup.
|
||||
*/
|
||||
public function stream_open($path, $mode, $options, &$opened_path)
|
||||
public function stream_open($path, $mode, $options, &$opened_path)
|
||||
{
|
||||
// get the view script source
|
||||
$path = str_replace('zend.view://', '', $path);
|
||||
$this->_data = file_get_contents($path);
|
||||
|
||||
|
||||
/**
|
||||
* If reading the file failed, update our local stat store
|
||||
* to reflect the real stat of the file, then return on failure
|
||||
@ -80,14 +80,14 @@ class Zend_View_Stream
|
||||
|
||||
/**
|
||||
* Convert <?= ?> to long-form <?php echo ?> and <? ?> to <?php ?>
|
||||
*
|
||||
*
|
||||
*/
|
||||
$this->_data = preg_replace('/\<\?\=/', "<?php echo ", $this->_data);
|
||||
$this->_data = preg_replace('/<\?(?!xml|php)/s', '<?php ', $this->_data);
|
||||
|
||||
|
||||
/**
|
||||
* file_get_contents() won't update PHP's stat cache, so we grab a stat
|
||||
* of the file to prevent additional reads should the script be
|
||||
* file_get_contents() won't update PHP's stat cache, so we grab a stat
|
||||
* of the file to prevent additional reads should the script be
|
||||
* requested again, which will make include() happy.
|
||||
*/
|
||||
$this->_stat = stat($path);
|
||||
@ -97,7 +97,7 @@ class Zend_View_Stream
|
||||
|
||||
/**
|
||||
* Included so that __FILE__ returns the appropriate info
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function url_stat()
|
||||
@ -108,45 +108,45 @@ class Zend_View_Stream
|
||||
/**
|
||||
* Reads from the stream.
|
||||
*/
|
||||
public function stream_read($count)
|
||||
public function stream_read($count)
|
||||
{
|
||||
$ret = substr($this->_data, $this->_pos, $count);
|
||||
$this->_pos += strlen($ret);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Tells the current position in the stream.
|
||||
*/
|
||||
public function stream_tell()
|
||||
public function stream_tell()
|
||||
{
|
||||
return $this->_pos;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Tells if we are at the end of the stream.
|
||||
*/
|
||||
public function stream_eof()
|
||||
public function stream_eof()
|
||||
{
|
||||
return $this->_pos >= strlen($this->_data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Stream statistics.
|
||||
*/
|
||||
public function stream_stat()
|
||||
public function stream_stat()
|
||||
{
|
||||
return $this->_stat;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Seek to a specific point in the stream.
|
||||
*/
|
||||
public function stream_seek($offset, $whence)
|
||||
public function stream_seek($offset, $whence)
|
||||
{
|
||||
switch ($whence) {
|
||||
case SEEK_SET:
|
||||
|
Reference in New Issue
Block a user