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


PHP Kwf_Component_Data_Root::getComponentClass方法代码示例

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


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

示例1: _getAllLanguages

 private function _getAllLanguages()
 {
     $config = Zend_Registry::get('config');
     $langs = array();
     if ($config->webCodeLanguage) {
         $langs[] = $config->webCodeLanguage;
     }
     if ($config->languages) {
         foreach ($config->languages as $lang => $name) {
             $langs[] = $lang;
         }
     }
     if (Kwf_Component_Data_Root::getComponentClass()) {
         foreach (Kwc_Abstract::getComponentClasses() as $c) {
             if (Kwc_Abstract::getFlag($c, 'hasAvailableLanguages')) {
                 foreach (call_user_func(array($c, 'getAvailableLanguages'), $c) as $i) {
                     if (!in_array($i, $langs)) {
                         $langs[] = $i;
                     }
                 }
             }
         }
     }
     $langs = array_unique($langs);
     return $langs;
 }
开发者ID:nsams,项目名称:koala-framework,代码行数:26,代码来源:Assets.php

示例2: getLanguages

 public static function getLanguages()
 {
     $config = Zend_Registry::get('config');
     $langs = array();
     if ($config->webCodeLanguage) {
         $langs[] = $config->webCodeLanguage;
     }
     $possibleUserLanguages = array();
     if ($config->languages) {
         foreach ($config->languages as $lang => $name) {
             $possibleUserLanguages[] = $lang;
         }
     }
     $userModel = Kwf_Registry::get('userModel');
     if (isset($userModel->getAuthedUser()->language) && $userModel->getAuthedUser()->language && in_array($userModel->getAuthedUser()->language, $possibleUserLanguages)) {
         $langs[] = $userModel->getAuthedUser()->language;
     }
     if (Kwf_Component_Data_Root::getComponentClass()) {
         $lngClasses = array();
         foreach (Kwc_Abstract::getComponentClasses() as $c) {
             if (Kwc_Abstract::hasSetting($c, 'baseProperties') && in_array('language', Kwc_Abstract::getSetting($c, 'baseProperties'))) {
                 $lngClasses[] = $c;
             }
         }
         $lngs = Kwf_Component_Data_Root::getInstance()->getComponentsBySameClass($lngClasses, array('ignoreVisible' => true));
         foreach ($lngs as $c) {
             if (Kwf_Registry::get('acl')->getComponentAcl()->isAllowed($userModel->getAuthedUser(), $c)) {
                 $langs[] = $c->getLanguage();
             }
         }
     }
     return array_unique($langs);
 }
开发者ID:nsams,项目名称:koala-framework,代码行数:33,代码来源:KwfController.php

示例3: __construct

 public function __construct()
 {
     $providers = array();
     if (Kwf_Component_Data_Root::getComponentClass()) {
         $providers[] = new Kwf_Assets_Components_Provider(Kwf_Component_Data_Root::getComponentClass());
     } else {
         $providers[] = new Kwf_Assets_Provider_NoComponents();
     }
     if (file_exists('dependencies.ini')) {
         $providers[] = new Kwf_Assets_Provider_Ini('dependencies.ini');
     }
     $providers = array_merge($providers, self::getVendorProviders());
     $providers[] = new Kwf_Assets_Provider_IniNoFiles();
     $providers[] = new Kwf_Assets_Provider_Dynamic();
     $providers[] = new Kwf_Assets_TinyMce_Provider();
     $providers[] = new Kwf_Assets_Provider_JsClassKwf();
     $providers[] = new Kwf_Assets_Provider_JsClass('./ext', 'web/ext', 'App');
     $providers[] = new Kwf_Assets_Provider_CssByJs(array('web/ext', 'kwf/commonjs'));
     $providers[] = new Kwf_Assets_Provider_ExtTrl();
     $providers[] = new Kwf_Assets_Provider_ErrorHandler();
     $providers[] = new Kwf_Assets_Provider_AtRequires();
     $providers[] = new Kwf_Assets_Provider_ViewsUser();
     $providers[] = new Kwf_Assets_Modernizr_Provider();
     $providers[] = new Kwf_Assets_CommonJs_Provider();
     $providers[] = new Kwf_Assets_Provider_KwfCommonJs();
     $providers[] = new Kwf_Assets_CommonJs_JQueryPluginProvider();
     $providers[] = new Kwf_Assets_ResponsiveEl_Provider();
     parent::__construct($providers);
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:29,代码来源:Default.php

示例4: output

 /**
  * Gibt den Komponenten-Baum aus (für CLI)
  **/
 public static function output()
 {
     $componentClass = Kwf_Component_Data_Root::getComponentClass();
     $model = new self();
     $maxComponentLength = self::_maxComponentLength($componentClass, $model);
     self::_output(null, $model, $maxComponentLength);
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:10,代码来源:Model.php

示例5: _renderHtml

 protected function _renderHtml($exception, $msg)
 {
     if ($this->getComponentClass() && Kwf_Component_Data_Root::getComponentClass() && isset($_SERVER['REQUEST_URI']) && isset($_SERVER['HTTP_HOST'])) {
         $uri = $_SERVER['REQUEST_URI'];
         $acceptLanguage = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : null;
         $data = null;
         while (!$data && $uri) {
             $data = Kwf_Component_Data_Root::getInstance()->getPageByUrl('http://' . $_SERVER['HTTP_HOST'] . $uri, $acceptLanguage);
             $uri = substr($uri, 0, strrpos($uri, '/'));
         }
         if (!$data) {
             $data = Kwf_Component_Data_Root::getInstance()->getPageByUrl('http://' . $_SERVER['HTTP_HOST'] . '/', $acceptLanguage);
         }
         if (!$data) {
             $data = Kwf_Component_Data_Root::getInstance();
         }
         $notFound = Kwf_Component_Data_Root::getInstance()->getComponentByClass($this->getComponentClass(), array('limit' => 1, 'subroot' => $data));
         if ($notFound) {
             return str_replace('{logId}', $this->_logId, $notFound->render(null, true));
         }
     }
     class_exists('Kwf_Trl');
     //eventually trigger autoloader
     $view = Kwf_Debug::getView();
     $view->exception = $msg;
     $view->message = $exception->getMessage();
     $view->requestUri = isset($_SERVER['REQUEST_URI']) ? htmlspecialchars($_SERVER['REQUEST_URI']) : '';
     $view->debug = Kwf_Exception::isDebug();
     try {
         if (Kwf_Registry::get('userModel') && Kwf_Registry::get('userModel')->getAuthedUserRole() == 'admin') {
             $view->debug = true;
         }
     } catch (Exception $e) {
     }
     if (Kwf_Component_Data_Root::getComponentClass()) {
         $data = null;
         if (isset($_SERVER['HTTP_HOST'])) {
             //try to get the page of current domain to get correct language
             $acceptLanguage = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : null;
             try {
                 $data = Kwf_Component_Data_Root::getInstance()->getPageByUrl('http://' . $_SERVER['HTTP_HOST'] . '/', $acceptLanguage);
             } catch (Exception $e) {
             }
         }
         if (!$data) {
             $data = Kwf_Component_Data_Root::getInstance();
         }
         $view->data = $data;
         //can be used for trl
     } else {
         //no components used, use Kwf_Trl object that also has trl() methods
         //HACK, but will work if only trl is used in template
         $view->data = Kwf_Trl::getInstance();
     }
     $template = $this->getTemplate();
     $template = strtolower(Zend_Filter::filterStatic($template, 'Word_CamelCaseToDash') . '.tpl');
     return $view->render($template);
 }
开发者ID:koala-framework,项目名称:koala-framework,代码行数:58,代码来源:Abstract.php

示例6: indexAction

 public function indexAction()
 {
     parent::indexAction();
     $this->view->assign(Kwc_Admin::getInstance($this->_getParam('class'))->getExtConfig());
     $this->view->baseParams = array('id' => $this->_getParam('componentId'), 'componentId' => $this->_getParam('componentId'));
     if ($this->getRequest()->module == 'component_test' && isset($this->view->controllerUrl)) {
         $this->view->controllerUrl = str_replace('/admin/component/edit/', '/kwf/componentedittest/' . Kwf_Component_Data_Root::getComponentClass() . '/', $this->view->controllerUrl);
     }
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:9,代码来源:Form.php

示例7: getTypes

 public function getTypes()
 {
     $types = array();
     if (Kwf_Component_Data_Root::getComponentClass()) {
         $types[] = new Kwf_Util_Build_Types_ComponentSettings();
     }
     $types[] = new Kwf_Util_Build_Types_Trl();
     $types[] = new Kwf_Util_Build_Types_Events();
     $types[] = new Kwf_Util_Build_Types_Assets();
     return $types;
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:11,代码来源:Build.php

示例8: __construct

 public function __construct($iniFile)
 {
     $providers = array();
     if (Kwf_Component_Data_Root::getComponentClass()) {
         $providers[] = new Kwf_Assets_Components_Provider(Kwf_Component_Data_Root::getComponentClass());
     }
     $providers[] = new Kwf_Assets_Provider_Ini(KWF_PATH . '/dependencies.ini');
     $providers[] = new Kwf_Assets_Provider_Ini($iniFile);
     $providers[] = new Kwf_Assets_Provider_Dynamic();
     parent::__construct($providers, array());
 }
开发者ID:koala-framework,项目名称:koala-framework,代码行数:11,代码来源:Test.php

示例9: indexAction

 public function indexAction()
 {
     $this->_config = Kwf_Registry::get('config');
     $assetsType = 'Frontend';
     $rootComponent = Kwf_Component_Data_Root::getComponentClass();
     foreach ($this->_config->assets->{$assetsType} as $d => $v) {
         if ($v) {
             $this->_processDependency($assetsType, $d, $rootComponent);
         }
     }
     exit;
 }
开发者ID:nsams,项目名称:koala-framework,代码行数:12,代码来源:AssetsDependenciesController.php

示例10: _build

 protected function _build()
 {
     if (!file_exists('build/trl')) {
         mkdir('build/trl');
     }
     foreach (glob('build/trl/*') as $f) {
         unlink($f);
     }
     $config = Zend_Registry::get('config');
     $langs = array();
     if ($config->webCodeLanguage) {
         $langs[] = $config->webCodeLanguage;
     }
     if ($config->languages) {
         foreach ($config->languages as $lang => $name) {
             $langs[] = $lang;
         }
     }
     try {
         if (Kwf_Component_Data_Root::getComponentClass()) {
             foreach (Kwc_Abstract::getComponentClasses() as $c) {
                 if (Kwc_Abstract::getFlag($c, 'hasAvailableLanguages')) {
                     foreach (call_user_func(array($c, 'getAvailableLanguages'), $c) as $i) {
                         if (!in_array($i, $langs)) {
                             $langs[] = $i;
                         }
                     }
                 }
             }
         }
     } catch (Kwf_Trl_BuildFileMissingException $e) {
         $originatingException = $e->getSettingsNonStaticTrlException();
         if ($originatingException) {
             throw $originatingException;
         }
         throw $e;
     }
     foreach ($langs as $l) {
         if ($l != $config->webCodeLanguage) {
             $c = $this->_loadTrlArray(Kwf_Trl::SOURCE_WEB, $l, true);
             file_put_contents(Kwf_Trl::generateBuildFileName(Kwf_Trl::SOURCE_WEB, $l, true), serialize($c));
             $c = $this->_loadTrlArray(Kwf_Trl::SOURCE_WEB, $l, false);
             file_put_contents(Kwf_Trl::generateBuildFileName(Kwf_Trl::SOURCE_WEB, $l, false), serialize($c));
         }
         if ($l != 'en') {
             $c = $this->_loadTrlArray(Kwf_Trl::SOURCE_KWF, $l, true);
             file_put_contents(Kwf_Trl::generateBuildFileName(Kwf_Trl::SOURCE_KWF, $l, true), serialize($c));
             $c = $this->_loadTrlArray(Kwf_Trl::SOURCE_KWF, $l, false);
             file_put_contents(Kwf_Trl::generateBuildFileName(Kwf_Trl::SOURCE_KWF, $l, false), serialize($c));
         }
     }
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:52,代码来源:Trl.php

示例11: getDomains

 public static function getDomains()
 {
     if (!Kwf_Component_Data_Root::getComponentClass()) {
         return null;
     }
     $ret = array();
     $acl = Zend_Registry::get('acl');
     $user = Kwf_Registry::get('userModel')->getAuthedUser();
     foreach (Kwf_Component_Data_Root::getInstance()->getDomainComponents() as $component) {
         if ($acl->getComponentAcl()->isAllowed($user, $component)) {
             $ret[$component->dbId] = $component->name;
         }
     }
     return $ret;
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:15,代码来源:RedirectController.php

示例12: getTypes

 public function getTypes()
 {
     $types = array();
     if (Kwf_Component_Data_Root::getComponentClass()) {
         $types[] = new Kwf_Util_Build_Types_ComponentSettings();
     }
     $types[] = new Kwf_Util_Build_Types_Trl();
     $types[] = new Kwf_Util_Build_Types_Events();
     $types[] = new Kwf_Util_Build_Types_Assets();
     if (Kwf_Component_Data_Root::getComponentClass()) {
         $types[] = new Kwf_Util_Build_Types_RteStyles();
     }
     $ev = new Kwf_Events_Event_FetchBuildTypes(get_class($this));
     Kwf_Events_Dispatcher::fireEvent($ev);
     $types = array_merge($types, $ev->types);
     return $types;
 }
开发者ID:koala-framework,项目名称:koala-framework,代码行数:17,代码来源:Build.php

示例13: getDomains

 public static function getDomains()
 {
     if (!Kwf_Component_Data_Root::getComponentClass()) {
         return null;
     }
     $domainComponentClasses = array();
     foreach (Kwc_Abstract::getComponentClasses() as $c) {
         if (Kwc_Abstract::hasSetting($c, 'baseProperties') && in_array('domain', Kwc_Abstract::getSetting($c, 'baseProperties'))) {
             $domainComponentClasses[] = $c;
         }
     }
     $domains = array();
     foreach (Kwf_Component_Data_Root::getInstance()->getComponentsBySameClass($domainComponentClasses, array('ignoreVisible' => true)) as $c) {
         $acl = Zend_Registry::get('acl');
         if ($acl->getComponentAcl()->isAllowed(Kwf_Registry::get('userModel')->getAuthedUser(), $c)) {
             $domains[$c->dbId] = $c->name;
         }
     }
     return $domains;
 }
开发者ID:nsams,项目名称:koala-framework,代码行数:20,代码来源:RedirectController.php

示例14: _afterInsert

 protected function _afterInsert()
 {
     parent::_afterInsert();
     $c = Kwc_Shop_Cart_Checkout_Payment_Wirecard_LogModel::decodeCallback($this->custom);
     if ($c && $c['cb']) {
         $ret = false;
         if (Kwf_Loader::isValidClass($c['cb'])) {
             $ret = call_user_func(array($c['cb'], 'processIpn'), $this, $c['data']);
         } else {
             if (Kwf_Component_Data_Root::getComponentClass()) {
                 $component = Kwf_Component_Data_Root::getInstance()->getComponentById($c['cb']);
                 if ($component) {
                     $ret = $component->getComponent()->processIpn($this, $c['data']);
                 }
             }
         }
         $this->callback_success = $ret;
         $this->save();
     }
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:20,代码来源:LogRow.php

示例15: __construct

 public function __construct($testDependenciesIni, $dependencyName = 'TestFiles', $rootComponentClass = null)
 {
     $this->_testDependenciesIni = $testDependenciesIni;
     if (is_null($rootComponentClass)) {
         $rootComponentClass = Kwf_Component_Data_Root::getComponentClass();
     }
     $this->_rootComponentClass = $rootComponentClass;
     $testDependenciesIni = str_replace('_', '/', $testDependenciesIni) . '/dependencies.ini';
     if (file_exists('tests/' . $testDependenciesIni)) {
         $testDependenciesIni = 'tests/' . $testDependenciesIni;
     } else {
         if (file_exists(KWF_PATH . '/tests/' . $testDependenciesIni)) {
             $testDependenciesIni = KWF_PATH . '/tests/' . $testDependenciesIni;
         }
     }
     $providers = array();
     $providers[] = new Kwf_Assets_Provider_Ini(KWF_PATH . '/dependencies.ini');
     $providers[] = new Kwf_Assets_Provider_Ini($testDependenciesIni);
     $providers = array_merge($providers, Kwf_Assets_ProviderList_Abstract::getVendorProviders());
     if (file_exists('dependencies.ini')) {
         $providers[] = new Kwf_Assets_Provider_Ini('dependencies.ini');
     }
     $providers[] = new Kwf_Assets_Provider_IniNoFiles();
     $providers[] = new Kwf_Assets_Provider_Components($rootComponentClass);
     $providers[] = new Kwf_Assets_Provider_Dynamic();
     $providers[] = new Kwf_Assets_TinyMce_Provider();
     $providers[] = new Kwf_Assets_Provider_KwfUtils();
     $providers[] = new Kwf_Assets_Provider_DefaultAssets();
     $providers[] = new Kwf_Assets_Provider_AtRequires();
     $providers[] = new Kwf_Assets_Provider_ViewsUser();
     $providers[] = new Kwf_Assets_Provider_ErrorHandler();
     $providers[] = new Kwf_Assets_Provider_JsClassKwf();
     $providers[] = new Kwf_Assets_Modernizr_Provider();
     $providerList = new Kwf_Assets_ProviderList_Abstract($providers);
     parent::__construct($providerList, $dependencyName);
 }
开发者ID:nsams,项目名称:koala-framework,代码行数:36,代码来源:TestPackage.php


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