当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Registry类代码示例

本文整理汇总了PHP中Zend_Registry的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Registry类的具体用法?PHP Zend_Registry怎么用?PHP Zend_Registry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Zend_Registry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getPanel

 /**
  * Gets content panel for the Debugbar
  *
  * @return string
  */
 public function getPanel()
 {
     $html = '<h4>Entr&eacute;es du registre (Zend_Registry)</h4>';
     $this->_registry->ksort();
     $html .= $this->_cleanData($this->_registry);
     return $html;
 }
开发者ID:rcomone,项目名称:bugtrack,代码行数:12,代码来源:Registry.php

示例2: preDispatch

 /**
  * Nastavuje ktere menu zobrazit a uklada do registru
  *
  * @param Zend_Controller_Request_Abstract $request
  * @todo Cachovat menu!!!
  */
 public function preDispatch(Zend_Controller_Request_Abstract $request)
 {
     $auth = Zend_Auth::getInstance();
     $identity = $auth->getIdentity();
     if ($request->getParam('projekt') > 0) {
         $this->_project = $request->getParam('projekt');
     }
     $this->_account = $request->getParam('account');
     switch ($request->module) {
         case 'mybase':
             $env = isset($this->_project) ? 'sub' : 'main';
             $config = new Zend_Config_Xml(APP_PATH . '/configs/navigation.xml', $env, true);
             $registry = new Zend_Registry();
             if ($registry->isRegistered('acl')) {
                 $acl = $registry->get('acl');
             }
             foreach ($config as $item) {
                 $item->params->account = $this->_account;
                 if (isset($item->pages)) {
                     foreach ($item->pages as $page) {
                         $page->params->account = $this->_account;
                         if (isset($page->params->projekt)) {
                             $page->params->projekt = $this->_project;
                             if ($acl->has($this->_project . '|' . $page->controller)) {
                                 $page->resource = $this->_project . '|' . $page->controller;
                             } else {
                                 $page->resource = 'noResource';
                             }
                         }
                         if (isset($page->pages)) {
                             foreach ($page->pages as $sub) {
                                 $sub->params->account = $this->_account;
                                 $sub->params->projekt = $this->_project;
                                 if ($acl->has($this->_project . '|' . $page->controller)) {
                                     $sub->resource = $this->_project . '|' . $page->controller;
                                 } else {
                                     $sub->resource = 'noResource';
                                 }
                             }
                         }
                     }
                 }
             }
             $navigation = new Zend_Navigation($config);
             Zend_Registry::set('Zend_Navigation', $navigation);
             break;
         default:
             //Zend_Registry::set('Zend_Navigation', $this->_DefaultMenu());
             break;
     }
 }
开发者ID:besters,项目名称:My-Base,代码行数:57,代码来源:Menu.php

示例3: getdivwitheditorAction

 /**
  *
  */
 public function getdivwitheditorAction()
 {
     $divId = $this->_getParam('dbid', false);
     $this->view->forcedStatus = $this->_getParam('status', '');
     if ($divId == false) {
         $this->view->div = "not loaded!";
     } else {
         $registry = new Zend_Registry();
         $this->view->customHelpers = $registry->get('customhelpers');
         $div = new Pagdivspage();
         $data = $div->getDiv($divId);
         $this->view->div = $data;
     }
 }
开发者ID:Cryde,项目名称:sydney-core,代码行数:17,代码来源:ServicesController.php

示例4: init

 public function init()
 {
     $view = Zend_Registry::get('Zend_View');
     $this->setTitle('Delete Sub Library');
     $this->setAttrib('class', 'global_form_popup');
     $this->setDescription('Are you sure that you want to delete this library? It will not be recoverable after being deleted.');
     //get table
     $mappingTable = Engine_Api::_()->getDbTable('mappings', 'user');
     //get videos mapping of library
     $params = array();
     $params['owner_type'] = $this->_library->getType();
     $params['owner_id'] = $this->_library->getIdentity();
     $videoMappings = $mappingTable->getItemsMapping('video', $params);
     if (count($this->_subs) && count($videoMappings)) {
         //get main Library
         $viewer = Engine_Api::_()->user()->getViewer();
         $mainLibrary = $viewer->getMainLibrary();
         $arrValue = array();
         $arrValue[0] = $view->translate('None');
         $arrValue[$mainLibrary->getIdentity()] = $view->translate($mainLibrary->getTitle());
         foreach ($this->_subs as $sub) {
             if ($sub->isSelf($this->_library)) {
                 continue;
             }
             $arrValue[$sub->getIdentity()] = $view->translate($sub->getTitle());
         }
         $this->addElement('Select', 'move_to', array('label' => 'Move to Library?', 'description' => 'If you delete this library, all existing content will be moved to another one.', 'multiOptions' => $arrValue));
     }
     $this->addElement('Button', 'submit_button', array('value' => 'submit_button', 'label' => 'Delete', 'onclick' => 'removeSubmit()', 'type' => 'submit', 'ignore' => true, 'decorators' => array('ViewHelper')));
     $this->addElement('Cancel', 'cancel', array('label' => 'cancel', 'link' => true, 'prependText' => ' or ', 'href' => '', 'onclick' => 'parent.Smoothbox.close();', 'decorators' => array('ViewHelper')));
     $this->addDisplayGroup(array('submit_button', 'cancel'), 'buttons', array('decorators' => array('FormElements', 'DivDivDivWrapper')));
 }
开发者ID:hoalangoc,项目名称:ftf,代码行数:32,代码来源:Delete.php

示例5: checkSkinStyles

 /**
  *
  */
 public function checkSkinStyles($name, $values)
 {
     $config = Zend_Registry::get('config');
     $basePath = $config->design->pathToSkins;
     $xhtml = array();
     $this->view->name = $name;
     $this->view->selectedStyles = $values;
     //load the skin folders
     if (is_dir('./' . $basePath)) {
         $folders = Digitalus_Filesystem_Dir::getDirectories('./' . $basePath);
         if (count($folders) > 0) {
             foreach ($folders as $folder) {
                 $this->view->skin = $folder;
                 $styles = Digitalus_Filesystem_File::getFilesByType('./' . $basePath . '/' . $folder . '/styles', 'css');
                 if (is_array($styles)) {
                     foreach ($styles as $style) {
                         //add each style sheet to the hash
                         // key = path / value = filename
                         $hashStyles[$style] = $style;
                     }
                     $this->view->styles = $hashStyles;
                     $xhtml[] = $this->view->render($this->partialFile);
                     unset($hashStyles);
                 }
             }
         }
     } else {
         throw new Zend_Acl_Exception('Unable to locate skin folder');
     }
     return implode(null, $xhtml);
 }
开发者ID:ngukho,项目名称:ducbui-cms,代码行数:34,代码来源:CheckSkinStyles.php

示例6: preDispatch

 public function preDispatch(Zend_Controller_Request_Abstract $request)
 {
     $auth = Zend_Auth::getInstance();
     $isAllowed = false;
     $controller = $request->getControllerName();
     $action = $request->getActionName();
     // Generate the resource name
     $resourceName = $controller . '/' . $action;
     // Don't block errors
     if ($resourceName == 'error/error') {
         return;
     }
     $resources = $this->acl->getResources();
     if (!in_array($resourceName, $resources)) {
         $request->setControllerName('error')->setActionName('error')->setDispatched(true);
         throw new Zend_Controller_Action_Exception('This page does not exist', 404);
         return;
     }
     // Check if user can access this resource or not
     $isAllowed = $this->acl->isAllowed(Zend_Registry::get('role'), $resourceName);
     // Forward user to access denied or login page if this is guest
     if (!$isAllowed) {
         if (!Zend_Auth::getInstance()->hasIdentity()) {
             $forwardAction = 'login';
         } else {
             $forwardAction = 'deny';
         }
         $request->setControllerName('index')->setActionName($forwardAction)->setDispatched(true);
     }
 }
开发者ID:georgepaul,项目名称:socialstrap,代码行数:30,代码来源:AccessCheck.php

示例7: _initConfig

 protected function _initConfig()
 {
     $aConfig = $this->getOptions();
     Zend_Registry::set('facebook_client_id', $aConfig['facebook']['client_id']);
     Zend_Registry::set('facebook_client_secret', $aConfig['facebook']['client_secret']);
     Zend_Registry::set('facebook_redirect_uri', $aConfig['facebook']['redirect_uri']);
 }
开发者ID:naegeles,项目名称:Logit,代码行数:7,代码来源:Bootstrap.php

示例8: init

 /**
  * Initialize controller
  *
  * @return void
  */
 function init()
 {
     $this->db = Zend_Registry::get('db');
     $this->logger = Zend_Registry::get('logger');
     $this->config = Zend_Registry::get('config');
     $this->viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
 }
开发者ID:ngroesz,项目名称:Photoplate,代码行数:12,代码来源:TemplateController.php

示例9: init

 public function init($styles = array())
 {
     // Init messages
     $this->view->message = array();
     $this->view->infoMessage = array();
     $this->view->errorMessage = array();
     $this->messenger = new Zend_Controller_Action_Helper_FlashMessenger();
     $this->messenger->setNamespace('messages');
     $this->_helper->addHelper($this->messenger);
     $this->errorMessenger = new Zend_Controller_Action_Helper_FlashMessenger();
     $this->errorMessenger->setNamespace('errorMessages');
     $this->_helper->addHelper($this->errorMessenger);
     $this->infoMessenger = new Zend_Controller_Action_Helper_FlashMessenger();
     $this->infoMessenger->setNamespace('infoMessages');
     $this->_helper->addHelper($this->infoMessenger);
     // Setup breadcrumbs
     $this->view->breadcrumbs = $this->buildBreadcrumbs($this->getRequest()->getRequestUri());
     $this->view->user = Zend_Auth::getInstance()->getIdentity();
     // Set the menu active element
     $uri = $this->getRequest()->getPathInfo();
     if (strrpos($uri, '/') === strlen($uri) - 1) {
         $uri = substr($uri, 0, -1);
     }
     if (!is_null($this->view->navigation()->findByUri($uri))) {
         $this->view->navigation()->findByUri($uri)->active = true;
     }
     $this->view->styleSheets = array_merge(array('css/styles.css'), $styles);
     $translate = Zend_Registry::get('tr');
     $this->view->tr = $translate;
     $this->view->setEscape(array('Lupin_Security', 'escape'));
 }
开发者ID:crlang44,项目名称:frapi,代码行数:31,代码来源:Base.php

示例10: init

 public function init()
 {
     $categories = Axis::single('catalog/category')->select('*')->addName(Axis_Locale::getLanguageId())->addKeyWord()->order('cc.lft')->addSiteFilter(Axis::getSiteId())->addDisabledFilter()->fetchAll();
     if (!is_array($this->_activeCategories)) {
         $this->_activeCategories = array();
         if (Zend_Registry::isRegistered('catalog/current_category')) {
             $this->_activeCategories = array_keys(Zend_Registry::get('catalog/current_category')->cache()->getParentItems());
         }
     }
     $container = $_container = new Zend_Navigation();
     $lvl = 0;
     $view = $this->getView();
     foreach ($categories as $_category) {
         $uri = $view->hurl(array('cat' => array('value' => $_category['id'], 'seo' => $_category['key_word']), 'controller' => 'catalog', 'action' => 'view'), false, true);
         $class = 'nav-' . str_replace('.', '-', $_category['key_word']);
         $page = new Zend_Navigation_Page_Uri(array('label' => $_category['name'], 'title' => $_category['name'], 'uri' => $uri, 'order' => $_category['lft'], 'class' => $class, 'visible' => 'enabled' === $_category['status'] ? true : false, 'active' => in_array($_category['id'], $this->_activeCategories)));
         $lvl = $lvl - $_category['lvl'] + 1;
         for ($i = 0; $i < $lvl; $i++) {
             $_container = $_container->getParent();
         }
         $lvl = $_category['lvl'];
         $_container->addPage($page);
         $_container = $page;
     }
     $this->setData('menu', $container);
     return true;
 }
开发者ID:rguedes,项目名称:axiscommerce,代码行数:27,代码来源:Navigation.php

示例11: routeShutdown

 public function routeShutdown(Zend_Controller_Request_Abstract $request)
 {
     $this->_view = Zend_Registry::get('view');
     $currentUrl = $this->_view->currentUrl('currentUrl');
     $model = new Modules_Seo_Model_Seo();
     $this->_data = $model->findByUrl($currentUrl);
 }
开发者ID:kytvi2p,项目名称:ZettaFramework,代码行数:7,代码来源:Seo.php

示例12: createAction

 /**
  * Enter description here...
  *
  */
 public function createAction()
 {
     $this->requirePost();
     $form = $this->getNewResidentForm();
     if ($form->isValid($_POST)) {
         if (!Table_Residents::getInstance()->residentExists($form->getValue('email'))) {
             $data = $form->getValues();
             $password = rand(10000, 9999999);
             $data['password_hash'] = md5($password);
             unset($data['aufnehmen']);
             $newResident = Table_Residents::getInstance()->createRow($data);
             if ($newResident && $newResident->save()) {
                 $websiteUrl = Zend_Registry::get('configuration')->basepath;
                 $mailText = "Du wurdest in die WG aufgenommen.\n\t\t\t\t\tDu kannst dich nun unter {$websiteUrl}/session/new anmelden.\n\n\t\t\t\t\tDeine Zugangsdaten:\n\n\t\t\t\t\tEmail Addresse = {$newResident->email}\n\t\t\t\t\tPassword = {$password}";
                 $mail = new Zend_Mail();
                 $mail->addTo($newResident->email)->setSubject("Du wurdest in der WG aufgenomme!")->setBodyText($mailText);
                 $mail->send();
                 $this->flash('Der Bewohner mit der Email Addresse ' . $newResident->email . ' wurde erfolgreich eingetragen.');
                 $this->flash('Ein generiertes Passwort wurde per Email zugeschickt.');
                 $this->redirect('index');
             } else {
                 $this->flash('Es trat ein Fehler beim speichern des neuen Bewohners auf.');
                 $this->redirect('new');
             }
         } else {
             $this->flash('Ein Bewohner mit der Emailaddresse ' . $form->getValue('email') . ' existiert bereits.');
             $this->redirect('new');
         }
     } else {
         $this->redirect('new');
     }
 }
开发者ID:h-xx,项目名称:wg-organizer,代码行数:36,代码来源:ResidentsController.php

示例13: getLogger

 /**
  * Get logger
  * 
  * @return Zend_Log
  */
 public function getLogger()
 {
     if (null === $this->logger) {
         $this->setLogger(Zend_Registry::get('logger'));
     }
     return $this->logger;
 }
开发者ID:lciolecki,项目名称:webshot,代码行数:12,代码来源:Log.php

示例14: getLogger

 public function getLogger()
 {
     if (is_null($this->_logger)) {
         $this->_logger = Zend_Registry::get('Zend_Log');
     }
     return $this->_logger;
 }
开发者ID:alexukua,项目名称:opus4,代码行数:7,代码来源:DefaultAccess.php

示例15: work

 public function work(Pheanstalk_Job $pJob)
 {
     try {
         $omekaJob = $this->_jobFactory->from($pJob->getData());
         if (!$omekaJob) {
             throw new UnexpectedValueException("Job factory returned null (should never happen).");
         }
         if ($omekaJob instanceof Omeka_Job_AbstractJob) {
             $user = $omekaJob->getUser();
             if ($user) {
                 Zend_Registry::get('bootstrap')->getContainer()->currentuser = $user;
             }
         }
         $omekaJob->perform();
         $this->_pheanstalk->delete($pJob);
     } catch (Zend_Db_Exception $e) {
         // Bury any jobs with database problems aside from stale
         // connections, which should indicate to try the job a second time.
         if (strpos($e->getMessage(), 'MySQL server has gone away') === false) {
             $this->_pheanstalk->bury($pJob);
         } else {
             $this->_pheanstalk->release($pJob);
         }
         throw $e;
     } catch (Omeka_Job_Worker_InterruptException $e) {
         $this->_interrupt($omekaJob);
         $this->_pheanstalk->release($pJob);
         throw $e;
     } catch (Exception $e) {
         $this->_pheanstalk->bury($pJob);
         throw $e;
     }
 }
开发者ID:lchen01,项目名称:STEdwards,代码行数:33,代码来源:Beanstalk.php


注:本文中的Zend_Registry类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。