本文整理汇总了PHP中Zend_Dojo_View_Helper_Dojo类的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Dojo_View_Helper_Dojo类的具体用法?PHP Zend_Dojo_View_Helper_Dojo怎么用?PHP Zend_Dojo_View_Helper_Dojo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Zend_Dojo_View_Helper_Dojo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testDeclarativeUseShouldRenderTextareaWithSimpleTextareaDojoType
public function testDeclarativeUseShouldRenderTextareaWithSimpleTextareaDojoType()
{
Zend_Dojo_View_Helper_Dojo::setUseDeclarative(true);
$html = $this->element->render();
$this->assertContains('id="foo"', $html);
$this->assertContains('<textarea', $html);
$this->assertContains('dojoType="dijit.form.SimpleTextarea"', $html);
}
示例2: setUp
/**
* Sets up the fixture, for example, open a network connection.
* This method is called before a test is executed.
*
* @return void
*/
public function setUp()
{
Zend_Registry::_unsetInstance();
Zend_Dojo_View_Helper_Dojo::setUseDeclarative();
$this->view = $this->getView();
$this->helper = new Zend_Dojo_View_Helper_Editor();
$this->helper->setView($this->view);
}
示例3: testDeclarativeUseShouldCreateTextareaWithSimpleTextareaDojoType
public function testDeclarativeUseShouldCreateTextareaWithSimpleTextareaDojoType()
{
Zend_Dojo_View_Helper_Dojo::setUseDeclarative(true);
$html = $this->helper->simpleTextarea('foo', 'seeded text');
$this->assertContains('id="foo"', $html);
$this->assertContains('<textarea', $html);
$this->assertContains('dojoType="dijit.form.SimpleTextarea"', $html);
}
示例4: changepasswordAction
public function changepasswordAction()
{
Zend_Layout::getMvcInstance()->disableLayout();
Zend_Dojo_View_Helper_Dojo::setUseDeclarative();
$form = new Application_Form_ChangePasswordForm();
$form->change->setAttrib('onclick', 'changePassword();');
$this->view->changePasswordForm = $form;
}
示例5: setUp
/**
* Sets up the fixture, for example, open a network connection.
* This method is called before a test is executed.
*
* @return void
*/
public function setUp()
{
Zend_Registry::_unsetInstance();
Zend_Dojo_View_Helper_Dojo::setUseDeclarative();
$this->view = $this->getView();
$this->element = $this->getElement();
$this->element->setView($this->view);
}
示例6: setUp
/**
* Sets up the fixture, for example, open a network connection.
* This method is called before a test is executed.
*
* @return void
*/
public function setUp()
{
Zend_Registry::_unsetInstance();
Zend_Dojo_View_Helper_Dojo::setUseDeclarative();
$this->view = $this->getView();
$this->decorator = new Zend_Dojo_Form_Decorator_SplitContainer();
$this->element = $this->getElement();
$this->element->setView($this->view);
$this->decorator->setElement($this->element);
}
示例7: preDispatch
/**
* Pre-Dispatch: set up dojo and context switching
*
* @return void
*/
public function preDispatch()
{
$request = $this->getRequest();
Zend_Dojo_View_Helper_Dojo::setUseDeclarative();
$contextSwitch = $this->_helper->contextSwitch;
if (!$contextSwitch->hasContext('ajax')) {
$contextSwitch->addContext('ajax', array('suffix' => 'ajax'))->addActionContext('new', 'ajax')->addActionContext('followup', 'ajax')->addActionContext('display', 'ajax')->addActionContext('active', 'ajax')->addActionContext('active-data', 'ajax')->addActionContext('active-data-count', 'ajax')->initContext();
}
$message = array('Current request information', array(array('Module', 'Controller', 'Action'), array($request->getModuleName(), $request->getControllerName(), $request->getActionName())));
Zend_Registry::get('log')->table($message);
}
示例8: init
public function init()
{
Zend_Dojo_View_Helper_Dojo::setUseDeclarative();
$this->view->addHelperPath('Zend/Dojo/View/Helper/', 'Zend_Dojo_View_Helper');
$session = $this->getRequest()->getCookie('sessionid');
$this->lib = new MetaNAS_Lib_MiniDLNA();
/*
* We need to make sure the user viewing this is logged in the MetaNAS GUI
* Pass the sessionid via JSON-RPC and make sure it has access
*/
$this->lib->isAuthorized($session);
}
示例9: _initDojo
protected function _initDojo()
{
$this->bootstrap('view');
$view = $this->getResource('view');
$view->addHelperPath('Zend/Dojo/View/Helper/', 'Zend_Dojo_View_Helper');
$view->dojo()->setLocalPath('/js/dojo/dojo.js');
$view->dojo()->addStylesheetModule('dijit.themes.tundra');
$view->dojo()->setDjConfigOption('usePlainJson', true);
$viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
$viewRenderer->setView($view);
Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
Zend_Dojo_View_Helper_Dojo::setUseProgrammatic();
}
示例10: init
public function init()
{
$this->view->addHelperPath('Zend/Dojo/View/Helper/', 'Zend_Dojo_View_Helper');
Zend_Dojo_View_Helper_Dojo::setUseDeclarative();
$layout = $this->_helper->layout;
$root = realpath(dirname(__FILE__) . '/../../../');
$layout->setLayoutPath(ZUPAL_LAYOUT_PATH);
$layout->setLayout('default');
$this->view->placeholder('base_path')->set($this->getFrontController()->getBaseUrl());
// note -- deprecated, using ZUPAL_BASEURL constant.
// $this->view->dojo()
// ->setLocalPath(ZUPAL_BASEURL . DS . 'scripts/Dojo/dojo/dojo.js')
//->requireModule('dijit.form.Form')
// ->setDjConfigOption('dojoBlankHtmUrl', '/blank.html');
}
示例11: dispatchLoopStartup
/**
* dispatchLoopStartup
*
* @param Zend_Controller_Request_Abstract $oRequest
* @return void
*/
public function dispatchLoopStartup(Zend_Controller_Request_Abstract $oRequest)
{
// Hack DOJO
Zend_Dojo_View_Helper_Dojo::setUseDeclarative();
$contextSwitch = Zend_Controller_Action_HelperBroker::getStaticHelper('ContextSwitch');
$contextParam = $contextSwitch->getContextParam();
$format = $oRequest->getParam($contextParam);
// Inject javascript vars
if (!$format or $format == "html" or $format == "html-json" or $format == "html-xml") {
$this->_view->dojo()->setDjConfigOption('ZlBaseUrl', $this->_view->baseUrl());
$this->_view->dojo()->setDjConfigOption('ZlBaseThemeUrl', $this->_view->baseThemeUrl());
$this->_view->dojo()->setDjConfigOption('ZlModule', $oRequest->getModuleName());
$this->_view->dojo()->setDjConfigOption('ZlController', $oRequest->getControllerName());
$this->_view->dojo()->setDjConfigOption('ZlAction', $oRequest->getActionName());
}
}
示例12: getForm
public static function getForm()
{
Zend_Dojo_View_Helper_Dojo::setUseDeclarative();
$form = new Zend_Form();
$form->setDecorators(array(array('ViewScript', array('viewScript' => 'editor/changesForm.phtml'))));
$zdate = new Zend_Date();
$e = new Zend_Dojo_Form_Element_DateTextBox('fromDate', array('label' => 'From', 'required' => true));
$e->setAttrib('onchange', 'admin.currentManObj.refresh()');
$form->addElement($e);
$e = new Zend_Dojo_Form_Element_DateTextBox('toDate', array('label' => 'To', 'required' => true));
$e->setAttrib('onchange', 'admin.currentManObj.refresh()');
$form->addElement($e);
// $e = new Zend_Dojo_Form_Element_Button( 'refresh', array ('label' => 'Refresh' ) );
// $e->setAttrib('onchange', 'admin.currentManObj.refresh()');
// $form->addElement($e);
Zend_Dojo::enableForm($form);
$form->setDefaults(array('toDate' => $zdate->getIso(), 'fromDate' => $zdate->getIso()));
return $form;
}
示例13: testShouldAllowProgrammaticDijitCreation
public function testShouldAllowProgrammaticDijitCreation()
{
Zend_Dojo_View_Helper_Dojo::setUseProgrammatic();
$html = $this->getContainer();
$this->assertNotRegexp('/<div[^>]*(dojoType="dijit.layout.TabContainer")/', $html);
$this->assertNotNull($this->view->dojo()->getDijit('container'));
}
示例14: testComboBoxInSubFormShouldCreateJsonStoreBasedOnQualifiedId
/**
* @group ZF-7134
* @group ZF-7266
*/
public function testComboBoxInSubFormShouldCreateJsonStoreBasedOnQualifiedId()
{
Zend_Dojo_View_Helper_Dojo::setUseProgrammatic();
$this->element->setStoreId('foo')->setStoreType('dojo.data.ItemFileReadStore')->setStoreParams(array('url' => '/foo'));
include_once 'Zend/Form/SubForm.php';
$subform = new Zend_Form_SubForm(array('name' => 'bar'));
$subform->addElement($this->element);
$html = $this->element->render();
$dojo = $this->view->dojo()->__toString();
$this->assertContains('"store":"foo"', $dojo, $dojo);
}
示例15: testStoreCreationWhenUsingProgrammaticCreationShouldRegisterAsDojoJavascript
/**
* @group ZF-5987
* @group ZF-7266
*/
public function testStoreCreationWhenUsingProgrammaticCreationShouldRegisterAsDojoJavascript()
{
Zend_Dojo_View_Helper_Dojo::setUseProgrammatic(true);
$html = $this->getElementAsRemoter();
$js = $this->view->dojo()->getJavascript();
$this->assertContains('var stateStore;', $js);
$onLoad = $this->view->dojo()->_getZendLoadActions();
$storeDeclarationFound = false;
foreach ($onLoad as $statement) {
if (strstr($statement, 'stateStore = new ')) {
$storeDeclarationFound = true;
break;
}
}
$this->assertTrue($storeDeclarationFound, 'Store definition not found');
}