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


PHP Pimcore_Tool::getCustomViewConfig方法代码示例

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


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

示例1: indexAction

 public function indexAction()
 {
     // check maintenance
     $maintenance_enabled = false;
     $manager = Schedule_Manager_Factory::getManager("maintenance.pid");
     $lastExecution = $manager->getLastExecution();
     if ($lastExecution) {
         if (time() - $lastExecution < 610) {
             // maintenance script should run at least every 10 minutes + a little tolerance
             $maintenance_enabled = true;
         }
     }
     $this->view->maintenance_enabled = Zend_Json::encode($maintenance_enabled);
     // configuration
     $this->view->config = Pimcore_Config::getSystemConfig();
     //mail settings
     $mailIncomplete = false;
     if ($this->view->config->email) {
         $emailSettings = $this->view->config->email->toArray();
         if ($emailSettings['method'] == "sendmail" and !empty($emailSettings['sender']['email'])) {
             $mailIncomplete = true;
         }
         if ($emailSettings['method'] == "smtp" and !empty($emailSettings['sender']['email']) and !empty($emailSettings['smtp']['host'])) {
             $mailIncomplete = true;
         }
     }
     $this->view->mail_settings_incomplete = Zend_Json::encode($mailIncomplete);
     // report configuration
     $this->view->report_config = Pimcore_Config::getReportConfig();
     // customviews config
     $cvConfig = Pimcore_Tool::getCustomViewConfig();
     $cvData = array();
     if ($cvConfig) {
         foreach ($cvConfig as $node) {
             $tmpData = $node;
             $rootNode = Object_Abstract::getByPath($tmpData["rootfolder"]);
             if ($rootNode) {
                 $tmpData["rootId"] = $rootNode->getId();
                 $tmpData["allowedClasses"] = explode(",", $tmpData["classes"]);
                 $tmpData["showroot"] = (bool) $tmpData["showroot"];
                 $cvData[] = $tmpData;
             }
         }
     }
     $this->view->customview_config = $cvData;
     // upload limit
     $max_upload = filesize2bytes(ini_get("upload_max_filesize") . "B");
     $max_post = filesize2bytes(ini_get("post_max_size") . "B");
     $memory_limit = filesize2bytes(ini_get("memory_limit") . "B");
     $upload_mb = min($max_upload, $max_post, $memory_limit);
     $this->view->upload_max_filesize = $upload_mb;
     // live connect
     $liveconnectToken = Pimcore_Liveconnect::getToken();
     $this->view->liveconnectToken = $liveconnectToken;
     // adding css minify filter because of IE issues with CkEditor and more than 31 stylesheets
     if (!PIMCORE_DEVMODE) {
         $front = Zend_Controller_Front::getInstance();
         $front->registerPlugin(new Pimcore_Controller_Plugin_CssMinify(), 800);
     }
 }
开发者ID:ngocanh,项目名称:pimcore,代码行数:60,代码来源:IndexController.php

示例2: adminCssAction

 public function adminCssAction()
 {
     // customviews config
     $cvData = Pimcore_Tool::getCustomViewConfig();
     $this->view->customviews = $cvData;
     $this->getResponse()->setHeader("Content-Type", "text/css; charset=UTF-8", true);
 }
开发者ID:shanky0110,项目名称:pimcore-custom,代码行数:7,代码来源:MiscController.php

示例3: treeGetChildsByIdAction

 public function treeGetChildsByIdAction()
 {
     $object = Object_Abstract::getById($this->_getParam("node"));
     $object->getPermissionsForUser($this->getUser());
     if ($object->hasChilds()) {
         $limit = intval($this->_getParam("limit"));
         if (!$this->_getParam("limit")) {
             $limit = 100000000;
         }
         $offset = intval($this->_getParam("start"));
         $childsList = new Object_List();
         $condition = "o_parentId = '" . $object->getId() . "'";
         // custom views start
         if ($this->_getParam("view")) {
             $cvConfig = Pimcore_Tool::getCustomViewConfig();
             $cv = $cvConfig[$this->_getParam("view") - 1];
             if ($cv["classes"]) {
                 $cvConditions = array();
                 $cvClasses = explode(",", $cv["classes"]);
                 foreach ($cvClasses as $cvClass) {
                     $cvConditions[] = "o_classId = '" . $cvClass . "'";
                 }
                 $cvConditions[] = "o_type = 'folder'";
                 if (count($cvConditions) > 0) {
                     $condition .= " AND (" . implode(" OR ", $cvConditions) . ")";
                 }
             }
         }
         // custom views end
         $childsList->setCondition($condition);
         $childsList->setLimit($limit);
         $childsList->setOffset($offset);
         $childsList->setOrderKey("o_key");
         $childsList->setOrder("asc");
         $childs = $childsList->load();
         foreach ($childs as $child) {
             $tmpObject = $this->getTreeNodeConfig($child);
             if ($child->isAllowed("list")) {
                 $objects[] = $tmpObject;
             }
         }
     }
     if ($this->_getParam("limit")) {
         $this->_helper->json(array("total" => $object->getChildAmount(), "nodes" => $objects));
     } else {
         $this->_helper->json($objects);
     }
 }
开发者ID:ngocanh,项目名称:pimcore,代码行数:48,代码来源:ObjectController.php

示例4: getCustomviewsAction

 public function getCustomviewsAction()
 {
     $data = Pimcore_Tool::getCustomViewConfig();
     $this->_helper->json(array("success" => true, "data" => $data));
 }
开发者ID:nblackman,项目名称:pimcore,代码行数:5,代码来源:ObjectHelperController.php

示例5: removeCustomView

 public function removeCustomView()
 {
     $customViews = Pimcore_Tool::getCustomViewConfig();
     if ($customViews) {
         foreach ($customViews as $key => $view) {
             if ($view['name'] == 'Blog') {
                 unset($customViews[$key]);
                 break;
             }
         }
         $writer = new Zend_Config_Writer_Xml(array('config' => new Zend_Config(array('views' => array('view' => $customViews))), 'filename' => PIMCORE_CONFIGURATION_DIRECTORY . '/customviews.xml'));
         $writer->write();
     }
 }
开发者ID:weblizards-gmbh,项目名称:blog,代码行数:14,代码来源:Install.php


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