當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Kwc_Abstract類代碼示例

本文整理匯總了PHP中Kwc_Abstract的典型用法代碼示例。如果您正苦於以下問題:PHP Kwc_Abstract類的具體用法?PHP Kwc_Abstract怎麽用?PHP Kwc_Abstract使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Kwc_Abstract類的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: getTemplateVars

 public function getTemplateVars()
 {
     $ret = parent::getTemplateVars();
     $feeds = Kwf_Component_Data_Root::getInstance()->getComponentsByClass('Kwc_Abstract_Feed_Component', array('subroot' => $this->getData()));
     $ret['feeds'] = $feeds;
     return $ret;
 }
開發者ID:xiaoguizhidao,項目名稱:koala-framework,代碼行數:7,代碼來源:Component.php

示例3: getAllChainedByMasterFromChainedStart

 public static function getAllChainedByMasterFromChainedStart($componentClass, $master, $chainedType, $parentDataSelect = array())
 {
     if (Kwc_Abstract::getFlag($componentClass, 'chainedType') != $chainedType) {
         return array();
     }
     $ret = array();
     foreach (Kwf_Component_Data_Root::getInstance()->getComponentsByClass($componentClass, $parentDataSelect) as $chainedStart) {
         //if additional subroots are above trl subroot (eg. domains)
         if ($sr = $chainedStart->parent->getSubroot()) {
             $masterSr = $master;
             while (Kwc_Abstract::getFlag($masterSr->componentClass, 'chainedType') != $chainedType) {
                 $masterSr = $masterSr->parent;
                 if (!$masterSr) {
                     continue 2;
                 }
             }
             if ($masterSr->parent && $sr != $masterSr->parent->getSubroot()) {
                 continue;
             }
         }
         $i = Kwc_Chained_Abstract_Component::getChainedByMaster($master, $chainedStart, $chainedType, $parentDataSelect);
         if ($i) {
             $ret[] = $i;
         }
     }
     return $ret;
 }
開發者ID:xiaoguizhidao,項目名稱:koala-framework,代碼行數:27,代碼來源:Component.php

示例4: componentWithMaster

 public function componentWithMaster(array $componentWithMaster)
 {
     $last = array_pop($componentWithMaster);
     $component = $last['data'];
     if ($last['type'] == 'master') {
         $innerComponent = $componentWithMaster[0]['data'];
         $vars = $component->getComponent()->getMasterTemplateVars($innerComponent, $this->_getRenderer());
         $vars['componentWithMaster'] = $componentWithMaster;
         if (Kwc_Abstract::hasSetting($component->componentClass, 'masterTemplate')) {
             $masterTemplate = Kwc_Abstract::getSetting($component->componentClass, 'masterTemplate');
         } else {
             $masterTemplate = $this->_getRenderer()->getTemplate($component, 'Master');
         }
         if (substr($masterTemplate, -4) == '.tpl') {
             $view = new Kwf_Component_View($this->_getRenderer());
             $view->assign($vars);
             $ret = $view->render($masterTemplate);
         } else {
             $twig = new Kwf_Component_Renderer_Twig_Environment($this->_getRenderer());
             $ret = $twig->render($masterTemplate, $vars);
         }
         $ret = $this->_replaceKwfUp($ret);
         return $ret;
     } else {
         if ($last['type'] == 'component') {
             $helper = new Kwf_Component_View_Helper_Component();
             $helper->setRenderer($this->_getRenderer());
             return '<div class="kwfMainContent">' . "\n    " . $helper->component($component) . "\n" . '</div>' . "\n";
         } else {
             throw new Kwf_Exception("invalid type");
         }
     }
 }
開發者ID:nsams,項目名稱:koala-framework,代碼行數:33,代碼來源:ComponentWithMaster.php

示例5: sendContent

 public function sendContent($includeMaster)
 {
     $data = $this->_data->getChildComponent('-child');
     $contentSender = Kwc_Abstract::getSetting($data->componentClass, 'contentSender');
     $contentSender = new $contentSender($data);
     $contentSender->sendContent($includeMaster);
 }
開發者ID:xiaoguizhidao,項目名稱:koala-framework,代碼行數:7,代碼來源:ContentSender.php

示例6: _initFields

 protected function _initFields()
 {
     $modelName = Kwc_Abstract::getSetting($this->_getParam('class'), 'projectsModel');
     $this->_form->setModel(Kwf_Model_Abstract::getInstance($modelName));
     $this->_form->add(new Kwf_Form_Field_TextField('text', trlKwf('Text')));
     $this->_form->add(new Kwf_Form_Field_Checkbox('visible', trlKwf('Visible')));
 }
開發者ID:xiaoguizhidao,項目名稱:koala-framework,代碼行數:7,代碼來源:ProjectController.php

示例7: _initFields

 protected function _initFields()
 {
     parent::_initFields();
     $showDirectoryClass = Kwc_Abstract::getSetting($this->getClass(), 'showDirectoryClass');
     $hideDirectoryClasses = Kwc_Abstract::getSetting($this->getClass(), 'hideDirectoryClasses');
     $cards = $this->add(new Kwf_Form_Container_Cards('source_component_id', trlKwf('Directory')));
     $defaultCard = null;
     $categories = Kwf_Component_Data_Root::getInstance()->getComponentsByClass('Kwc_Directories_Category_Directory_Component');
     foreach ($categories as $category) {
         $itemDirectory = $category->parent;
         if (is_instance_of($itemDirectory->componentClass, $showDirectoryClass)) {
             foreach ($hideDirectoryClasses as $c) {
                 if (is_instance_of($itemDirectory->componentClass, $c)) {
                     continue 2;
                 }
             }
             $categoriesModel = $category->getComponent()->getChildModel();
             $select = $categoriesModel->select()->whereEquals('component_id', $category->componentId);
             $values = array();
             foreach ($categoriesModel->getRows($select) as $row) {
                 $values[$row->id] = $row->name;
             }
             $card = $cards->add();
             $card->setTitle($category->parent->getTitle());
             $card->setName($category->componentId);
             if (!$defaultCard) {
                 $defaultCard = $category->componentId;
             }
             $model = Kwf_Model_Abstract::getInstance('Kwc_Directories_Category_ShowCategories_Model');
             $card->add(new Kwf_Form_Field_MultiCheckboxLegacy($model, trlKwf('Categories')))->setValues($values)->setReferences(array('columns' => array('component_id'), 'refColumns' => array('id')))->setColumnName('category_id');
         }
     }
     $cards->setDefaultValue($defaultCard);
 }
開發者ID:xiaoguizhidao,項目名稱:koala-framework,代碼行數:34,代碼來源:Form.php

示例8: getTemplateVars

 public function getTemplateVars()
 {
     $ret = parent::getTemplateVars();
     $page = $this->getData()->getPage();
     $ret['childPages'] = $page->getChildPages();
     return $ret;
 }
開發者ID:xiaoguizhidao,項目名稱:koala-framework,代碼行數:7,代碼來源:Component.php

示例9: getSettings

 public static function getSettings()
 {
     $ret = parent::getSettings();
     $ret['flags']['foo'] = true;
     $ret['generators']['test'] = array('class' => 'Kwf_Component_Generator_Static', 'component' => 'Kwf_Component_Generator_Indirect_Flag2');
     return $ret;
 }
開發者ID:xiaoguizhidao,項目名稱:koala-framework,代碼行數:7,代碼來源:Flag.php

示例10: getTemplateVarsWithNetworks

 public function getTemplateVarsWithNetworks($currentPage)
 {
     $ret = parent::getTemplateVars();
     $ret['networks'] = $this->_getNetworks($currentPage);
     $ret['iconSet'] = $this->_getSetting('iconSet');
     return $ret;
 }
開發者ID:xiaoguizhidao,項目名稱:koala-framework,代碼行數:7,代碼來源:Component.php

示例11: getSettings

 public static function getSettings($param = null)
 {
     $ret = parent::getSettings($param);
     $ret['componentName'] = 'Foo';
     $ret['ownModel'] = new Kwf_Model_FnF(array('primaryKey' => 'component_id'));
     return $ret;
 }
開發者ID:koala-framework,項目名稱:koala-framework,代碼行數:7,代碼來源:Component.php

示例12: getTemplateVars

 public function getTemplateVars()
 {
     $ret = parent::getTemplateVars();
     $ret['componentClass'] = get_class($this);
     $ret['test2'] = $this->getData()->getChildComponent('_test2');
     return $ret;
 }
開發者ID:xiaoguizhidao,項目名稱:koala-framework,代碼行數:7,代碼來源:Component.php

示例13: getSettings

 public static function getSettings($param = null)
 {
     $ret = parent::getSettings($param);
     $ret['generators']['test'] = array('class' => 'Kwf_Component_Generator_Page_Static', 'component' => 'Kwc_Lightbox_Content_TestComponent_Component');
     $ret['viewCache'] = false;
     return $ret;
 }
開發者ID:koala-framework,項目名稱:koala-framework,代碼行數:7,代碼來源:Component.php

示例14: getSettings

 public static function getSettings()
 {
     $ret = parent::getSettings();
     $ret['generators']['composite'] = array('class' => 'Kwf_Component_Generator_Page_Static', 'component' => 'Kwc_Cc_Composite_Master_Composite_Component');
     $ret['flags']['chainedType'] = 'Cc';
     return $ret;
 }
開發者ID:xiaoguizhidao,項目名稱:koala-framework,代碼行數:7,代碼來源:Component.php

示例15: getSettings

 public static function getSettings($param = null)
 {
     $ret = parent::getSettings($param);
     $ret['rootElementClass'] = 'kwfUp-webStandard';
     $ret['flags']['noIndex'] = true;
     return $ret;
 }
開發者ID:koala-framework,項目名稱:koala-framework,代碼行數:7,代碼來源:Component.php


注:本文中的Kwc_Abstract類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。