本文整理汇总了PHP中Kwc_Abstract::getChildComponentClass方法的典型用法代码示例。如果您正苦于以下问题:PHP Kwc_Abstract::getChildComponentClass方法的具体用法?PHP Kwc_Abstract::getChildComponentClass怎么用?PHP Kwc_Abstract::getChildComponentClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kwc_Abstract
的用法示例。
在下文中一共展示了Kwc_Abstract::getChildComponentClass方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _initFields
protected function _initFields()
{
parent::_initFields();
$userEditForm = $this->fields->add(new $this->_userDataFormName('user'));
$userEditForm->setIdTemplate('{0}');
$root = Kwf_Component_Data_Root::getInstance();
if ($root) {
$userDirectory = $root->getComponentByClass('Kwc_User_Directory_Component');
}
if ($root && isset($userDirectory) && $userDirectory) {
$detailClass = Kwc_Abstract::getChildComponentClass($userDirectory->componentClass, 'detail');
$userEditForm->addUserForms($detailClass, array('general'));
$userEditForm->fields['firstname']->setAllowBlank(true);
$userEditForm->fields['lastname']->setAllowBlank(true);
} else {
$this->fields->add(new Kwc_User_Detail_General_Form('general', null))->setIdTemplate('{0}');
}
$config = Zend_Registry::get('config');
$authedUser = Kwf_Registry::get('userModel')->getAuthedUser();
if (isset($authedUser->language) && $config->languages) {
$data = array();
foreach ($config->languages as $key => $value) {
$data[$key] = $value;
}
$this->fields->add(new Kwf_Form_Field_Select('language', trlKwf('Language')))->setValues($data);
}
}
示例2: _delete
protected function _delete()
{
$componentClass = $this->getTable()->getComponentClass();
$class = Kwc_Abstract::getChildComponentClass($componentClass, 'child');
$admin = Kwc_Admin::getInstance($class);
$admin->delete($this->component_id . '-' . $this->id);
}
示例3: alterBackendOrderForm
public function alterBackendOrderForm(Kwc_Shop_AddToCartAbstract_FrontendForm $form)
{
$component = null;
foreach (Kwc_Abstract::getComponentClasses() as $c) {
if (is_instance_of($c, 'Kwc_Shop_Products_Directory_Component')) {
$detailClasses = Kwc_Abstract::getChildComponentClasses($c, 'detail');
foreach ($detailClasses as $key => $class) {
if (Kwc_Abstract::getChildComponentClass($class, 'addToCart') == $this->_class) {
$component = $key;
}
}
}
}
$m = Kwf_Model_Abstract::getInstance('Kwc_Shop_Products');
$s = $m->select();
$s->whereEquals('visible', 1);
if ($component) {
$s->whereEquals('component', $component);
}
$s->order('pos');
$data = array();
foreach ($m->getRows($s) as $product) {
$data[] = array($product->current_price_id, $product->__toString() . ' (' . $product->current_price . ' €)');
}
$form->prepend(new Kwf_Form_Field_Select('shop_product_price_id', trlKwfStatic('Product')))->setValues($data)->setAllowBlank(false);
}
示例4: _initColumns
protected function _initColumns()
{
$c = Kwc_Abstract::getChildComponentClass($this->_getParam('class'), 'child');
foreach (Kwc_Admin::getInstance($c)->gridColumns() as $i) {
$this->_columns->add($i);
}
$this->_columns->add(new Kwf_Grid_Column_Visible());
}
示例5: getListeners
public function getListeners()
{
$ret = parent::getListeners();
$childImage = Kwc_Abstract::getChildComponentClass($this->_class, 'image');
$ret[] = array('class' => $childImage, 'event' => 'Kwf_Component_Event_Component_HasContentChanged', 'callback' => 'onOwnImageHasContentChanged');
$ret[] = array('class' => Kwc_Abstract::getSetting($this->_class, 'masterComponentClass'), 'event' => 'Kwf_Events_Event_Media_Changed', 'callback' => 'onMasterMediaChanged');
return $ret;
}
示例6: getItemDirectoryClasses
public static function getItemDirectoryClasses($directoryClass)
{
$ret = array();
$class = self::_getParentItemDirectoryClasses($directoryClass, 0);
foreach ($class as $c) {
$ret[] = Kwc_Abstract::getChildComponentClass($c, 'products');
}
return $ret;
}
示例7: _beforeDelete
protected function _beforeDelete()
{
parent::_beforeDelete();
// Dranhängende Komponente löschen
$generators = Kwf_Component_Data_Root::getInstance()->getPageGenerators();
foreach ($generators as $generator) {
$class = Kwc_Abstract::getChildComponentClass($generator->getClass(), null, $this->component);
Kwc_Admin::getInstance($class)->delete($this->id);
}
}
示例8: _initUserForm
protected function _initUserForm()
{
if (is_instance_of($this->getData()->parent->parent->componentClass, 'Kwc_User_Directory_Component')) {
$detailClass = Kwc_Abstract::getChildComponentClass($this->getData()->parent->parent->componentClass, 'detail');
$forms = Kwc_Abstract::getSetting($this->getData()->parent->componentClass, 'forms');
$this->_form->addUserForms($detailClass, $forms);
} else {
$this->_form->add(new Kwc_User_Detail_General_Form('general', null));
}
}
示例9: _getConfig
protected function _getConfig()
{
$detail = Kwc_Abstract::getChildComponentClass($this->_class, 'child');
$gen = Kwf_Component_Generator_Abstract::getInstance($this->_class, 'child');
$edit = Kwf_Component_Abstract_ExtConfig_Abstract::getEditConfigs($detail, $gen);
$config = $this->_getStandardConfig('kwc.list.listEditButton', 'ListEditButton');
$config['componentConfigs'] = $edit['componentConfigs'];
$config['contentEditComponents'] = $edit['contentEditComponents'];
$config['needsComponentPanel'] = true;
return array('list' => $config);
}
示例10: _getConfig
protected function _getConfig()
{
$detail = Kwc_Abstract::getChildComponentClass($this->_class, 'child');
$gen = Kwf_Component_Generator_Abstract::getInstance($this->_class, 'child');
$edit = Kwf_Component_Abstract_ExtConfig_Abstract::getEditConfigs($detail, $gen);
$config = $this->_getStandardConfig('kwc.list.list');
$config['componentConfigs'] = $edit['componentConfigs'];
$config['contentEditComponents'] = $edit['contentEditComponents'];
$config['useInsertAdd'] = true;
$config['listTitle'] = null;
$config['editForms'] = array();
return array('list' => $config);
}
示例11: _initFields
protected function _initFields()
{
$this->_form->setModel(Kwf_Model_Abstract::getInstance(Kwc_Abstract::getSetting(Kwf_Component_Data_Root::getInstance()->getComponentByDbId($this->_getParam('componentId'))->parent->componentClass, 'childModel'))->getReferencedModel('Order'));
$this->_form->add(new Kwf_Form_Field_ComboBoxText('origin', trlKwf('Origin')))->setValues(array(trlKwf('Internet'), trlKwf('Phone'), trlKwf('Folder'), trlKwf('Fair')))->setShowNoSelection(true);
$cc = Kwc_Abstract::getChildComponentClasses($this->_getParam('class'), 'payment');
$payments = array();
foreach ($cc as $k => $c) {
$payments[$k] = Kwc_Abstract::getSetting($c, 'componentName');
}
if (count($payments) > 1) {
$this->_form->add(new Kwf_Form_Field_Select('payment', trlKwf('Payment')))->setValues($payments)->setAllowBlank(false);
}
$cols = $this->_form->add(new Kwf_Form_Container_Columns());
$col = $cols->add();
$col->add(new Kwf_Form_Field_ShowField('order_number', trlKwf('Order Nr')));
$col = $cols->add();
$col->add(new Kwf_Form_Field_ShowField('customer_number', trlKwf('Customer Nr')));
if (Kwc_Abstract::getSetting($this->_getParam('class'), 'generateInvoices')) {
$this->_form->add(new Kwf_Form_Field_ShowField('invoice_number', trlKwf('Invoice Nr')));
$this->_form->add(new Kwf_Form_Field_DateField('invoice_date', trlKwf('Invoice Date')));
}
$this->_form->add(new Kwf_Form_Field_DateField('payed', trlKwf('Payed')));
$this->_form->add(new Kwf_Form_Field_ShowField('shipped', trlKwf('Shipped')))->setTpl('{value:localizedDate}');
$this->_form->add(new Kwf_Form_Field_Checkbox('canceled', trlKwf('Canceled')));
$fs = $this->_form->add(new Kwf_Form_Container_FieldSet(trlKwf('Customer')));
$formComponent = Kwc_Abstract::getChildComponentClass($this->_getParam('class'), 'child', 'form');
$formClass = Kwc_Admin::getComponentClass($formComponent, 'FrontendForm');
$customerForm = new $formClass('form', $formComponent);
$customerForm->setIdTemplate('{0}');
$customerForm->setModel($this->_form->getModel());
$fs->add($customerForm);
unset($customerForm->fields['payment']);
foreach ($customerForm->fields as $f) {
if ($f->getHideFieldInBackend()) {
$customerForm->fields->remove($f);
}
}
$customerForm->fields['email']->setAllowBlank(true);
$customerForm->setAllowEmptyCart(true);
foreach (Kwc_Abstract::getComponentClasses() as $c) {
$g = Kwc_Abstract::getSetting($c, 'generators');
if (isset($g['checkout']) && $g['checkout']['component'] == $this->_getParam('class')) {
foreach (Kwc_Abstract::getSetting($c, 'plugins') as $p) {
if (is_instance_of($p, 'Kwc_Shop_Cart_Plugins_Interface')) {
$p = new $p();
$p->alterBackendOrderForm($this->_form);
}
}
}
}
}
示例12: getListeners
public function getListeners()
{
$ret = parent::getListeners();
foreach (Kwc_Abstract::getComponentClasses() as $class) {
if (is_instance_of($class, 'Kwc_Basic_ImageEnlarge_Trl_Component') && $this->_canCreateUsIndirectly($class)) {
$imageClass = Kwc_Abstract::getChildComponentClass($class, 'image');
$ret[] = array('class' => $imageClass, 'event' => 'Kwc_Abstract_Image_ImageChangedEvent', 'callback' => 'onImageChanged');
$ret[] = array('class' => $imageClass, 'event' => 'Kwf_Component_Event_ComponentClass_ContentChanged', 'callback' => 'onClassContentChanged');
$masterComponentClass = Kwc_Abstract::getSetting($class, 'masterComponentClass');
$ret[] = array('class' => $masterComponentClass, 'event' => 'Kwc_Abstract_Image_ImageChangedEvent', 'callback' => 'onMasterImageChanged');
$ret[] = array('class' => $masterComponentClass, 'event' => 'Kwf_Component_Event_ComponentClass_ContentChanged', 'callback' => 'onClassContentChanged');
$ret[] = array('class' => $class, 'event' => 'Kwf_Component_Event_Component_ContentChanged', 'callback' => 'onImageContentChanged');
$ret[] = array('class' => $class, 'event' => 'Kwf_Component_Event_ComponentClass_ContentChanged', 'callback' => 'onClassContentChanged');
}
}
return $ret;
}
示例13: getListeners
public function getListeners()
{
$ret = array();
foreach (Kwc_Abstract::getComponentClasses() as $class) {
if (in_array('Kwc_Directories_List_Component', Kwc_Abstract::getParentClasses($class)) || in_array('Kwc_Directories_List_Trl_Component', Kwc_Abstract::getParentClasses($class))) {
if (Kwc_Abstract::hasChildComponentClass($class, 'feed') && $this->_class == Kwc_Abstract::getChildComponentClass($class, 'feed')) {
$directoryClasses = call_user_func(array(strpos($class, '.') ? substr($class, 0, strpos($class, '.')) : $class, 'getItemDirectoryClasses'), $class);
foreach ($directoryClasses as $directoryClass) {
$ret[] = array('class' => $directoryClass, 'event' => 'Kwc_Directories_List_EventItemInserted', 'callback' => 'onDirectoryUpdate');
$ret[] = array('class' => $directoryClass, 'event' => 'Kwc_Directories_List_EventItemDeleted', 'callback' => 'onDirectoryUpdate');
$ret[] = array('class' => $directoryClass, 'event' => 'Kwc_Directories_List_EventItemUpdated', 'callback' => 'onDirectoryUpdate');
$ret[] = array('class' => $directoryClass, 'event' => 'Kwc_Directories_List_EventItemsUpdated', 'callback' => 'onDirectoryUpdate');
}
}
}
}
return $ret;
}
示例14: _initColumns
protected function _initColumns()
{
parent::_initColumns();
$this->_columns->add(new Kwf_Grid_Column_Visible());
if ($this->_showChildComponentGridColumns) {
$c = Kwc_Abstract::getChildComponentClass($this->_getParam('class'), 'child');
foreach (Kwc_Admin::getInstance($c)->gridColumns() as $i) {
$this->_columns->add($i);
}
}
foreach (Kwf_Component_Data_Root::getInstance()->getPlugins('Kwf_Component_PluginRoot_Interface_GeneratorProperty') as $plugin) {
$params = $plugin->getGeneratorProperty(Kwf_Component_Generator_Abstract::getInstance($this->_getParam('class'), 'child'));
if ($params) {
$editor = new Kwf_Form_Field_Select();
$editor->setValues($params['values'])->setListWidth(200);
$this->_columns->add(new Kwf_Grid_Column($params['name'], $params['label']))->setEditor($editor)->setShowDataIndex($params['name'] . '_text')->setData(new Kwf_Component_PluginRoot_GeneratorProperty_Data($plugin));
$this->_columns->add(new Kwf_Grid_Column($params['name'] . '_text'))->setData(new Kwf_Component_PluginRoot_GeneratorProperty_DataText($plugin));
}
}
}
示例15: _fireTagEvent
private function _fireTagEvent($event, $directory, $itemId = null)
{
$cacheId = 'kwc-dirlistview-isdata-' . $this->_class;
$dirIs = Kwf_Cache_SimpleStatic::fetch($cacheId);
if ($dirIs === false) {
$dirIs = array('data' => false, 'string' => false);
foreach (Kwc_Abstract::getComponentClasses() as $class) {
if (in_array('Kwc_Directories_List_Component', Kwc_Abstract::getParentClasses($class)) || in_array('Kwc_Directories_List_Trl_Component', Kwc_Abstract::getParentClasses($class))) {
if (Kwc_Abstract::hasChildComponentClass($class, 'child', 'view') && $this->_class == Kwc_Abstract::getChildComponentClass($class, 'child', 'view')) {
$isData = call_user_func(array(strpos($class, '.') ? substr($class, 0, strpos($class, '.')) : $class, 'getItemDirectoryIsData'), $class);
if ($isData) {
$dirIs['data'] = true;
} else {
$dirIs['string'] = true;
}
}
}
}
Kwf_Cache_SimpleStatic::add($cacheId, $dirIs);
}
$event = "Kwf_Component_Event_ComponentClass_Tag_{$event}";
if ($itemId) {
if ($dirIs['data']) {
$this->fireEvent(new $event($this->_class, $directory->componentId, $itemId));
}
if ($dirIs['string']) {
$this->fireEvent(new $event($this->_class, $directory->componentClass, $itemId));
}
} else {
if ($dirIs['data']) {
$this->fireEvent(new $event($this->_class, $directory->componentId));
}
if ($dirIs['string']) {
$this->fireEvent(new $event($this->_class, $directory->componentClass));
}
}
}