本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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");
}
}
}
示例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);
}
示例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')));
}
示例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);
}
示例8: getTemplateVars
public function getTemplateVars()
{
$ret = parent::getTemplateVars();
$page = $this->getData()->getPage();
$ret['childPages'] = $page->getChildPages();
return $ret;
}
示例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;
}
示例10: getTemplateVarsWithNetworks
public function getTemplateVarsWithNetworks($currentPage)
{
$ret = parent::getTemplateVars();
$ret['networks'] = $this->_getNetworks($currentPage);
$ret['iconSet'] = $this->_getSetting('iconSet');
return $ret;
}
示例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;
}
示例12: getTemplateVars
public function getTemplateVars()
{
$ret = parent::getTemplateVars();
$ret['componentClass'] = get_class($this);
$ret['test2'] = $this->getData()->getChildComponent('_test2');
return $ret;
}
示例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;
}
示例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;
}
示例15: getSettings
public static function getSettings($param = null)
{
$ret = parent::getSettings($param);
$ret['rootElementClass'] = 'kwfUp-webStandard';
$ret['flags']['noIndex'] = true;
return $ret;
}