本文整理汇总了PHP中Kwc_Abstract::getChildComponentClasses方法的典型用法代码示例。如果您正苦于以下问题:PHP Kwc_Abstract::getChildComponentClasses方法的具体用法?PHP Kwc_Abstract::getChildComponentClasses怎么用?PHP Kwc_Abstract::getChildComponentClasses使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kwc_Abstract
的用法示例。
在下文中一共展示了Kwc_Abstract::getChildComponentClasses方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getListeners
public function getListeners()
{
$ret = array();
$processedDirectories = array();
$processedDetails = 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)) || in_array('Kwc_Directories_List_Cc_Component', Kwc_Abstract::getParentClasses($class))) {
if (Kwc_Abstract::hasChildComponentClass($class, 'child', 'view') && $this->_class == Kwc_Abstract::getChildComponentClass($class, 'child', 'view')) {
$directoryClasses = call_user_func(array(strpos($class, '.') ? substr($class, 0, strpos($class, '.')) : $class, 'getItemDirectoryClasses'), $class);
foreach ($directoryClasses as $directoryClass) {
if (in_array($directoryClass, $processedDirectories)) {
//add only once
continue;
}
$processedDirectories[] = $directoryClass;
foreach (Kwc_Abstract::getChildComponentClasses($directoryClass, 'detail') as $detailClass) {
if (in_array($detailClass, $processedDetails)) {
//add only once
continue;
}
$processedDetails[] = $detailClass;
$ret[] = array('class' => $detailClass, 'event' => 'Kwf_Component_Event_Component_Added', 'callback' => 'onDirectoryDetailAdded');
$ret[] = array('class' => $detailClass, 'event' => 'Kwf_Component_Event_Component_Removed', 'callback' => 'onDirectoryDetailRemoved');
$ret[] = array('class' => $detailClass, 'event' => 'Kwf_Component_Event_Component_HasContentChanged', 'callback' => 'onDirectoryDetailHasContentChanged');
}
$ret[] = array('class' => $directoryClass, 'event' => 'Kwc_Directories_List_EventItemUpdated', 'callback' => 'onDirectoryRowUpdate');
$ret[] = array('class' => $directoryClass, 'event' => 'Kwc_Directories_List_EventItemsUpdated', 'callback' => 'onDirectoryModelUpdate');
}
}
}
}
return $ret;
}
示例2: _delete
protected function _delete()
{
$classes = Kwc_Abstract::getChildComponentClasses($this->getTable()->getComponentClass(), 'child');
foreach ($classes as $k => $i) {
Kwc_Admin::getInstance($i)->delete($this->component_id . '-' . $k);
}
}
示例3: testSlave
public function testSlave()
{
$cc = Kwc_Abstract::getChildComponentClasses('Kwf_Component_ChainedNeedsParentCc_Chained_Component.Kwf_Component_ChainedNeedsParentCc_Master_Component');
$m = Kwc_Abstract::getSetting($cc[0], 'masterComponentClass');
$pc = Kwc_Abstract::getSetting($m, 'parentComponentClass');
$this->assertEquals($pc, 'Kwf_Component_ChainedNeedsParentCc_Master_Component');
}
示例4: 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);
}
示例5: _getConfig
protected function _getConfig()
{
$classes = Kwc_Abstract::getChildComponentClasses($this->_class, 'child');
$config = $this->_getStandardConfig('kwf.tabpanel', null);
$config['activeTab'] = 0;
$titles = array();
foreach ($classes as $id => $cls) {
$c = array_values(Kwc_Admin::getInstance($cls)->getExtConfig());
foreach ($c as $i) {
//TODO: hier nicht den titel als index verwenden, das stinkt
$componentIdSuffix = '-' . $id;
if (isset($i['componentIdSuffix'])) {
$componentIdSuffix .= $i['componentIdSuffix'];
}
$i['componentIdSuffix'] = $componentIdSuffix;
if (!isset($titles[$i['title']])) {
$titles[$i['title']] = 0;
}
if ($titles[$i['title']]++ > 0) {
$i['title'] .= ' ' . $titles[$i['title']];
}
$config['tabs'][$i['title']] = $i;
}
}
return array('tabs' => $config);
}
示例6: _initColumns
protected function _initColumns()
{
$this->_model = Kwf_Model_Abstract::getInstance(Kwc_Abstract::getSetting(Kwf_Component_Data_Root::getInstance()->getComponentByDbId($this->_getParam('componentId'))->parent->componentClass, 'childModel'))->getReferencedModel('Order');
$cc = Kwc_Abstract::getChildComponentClasses($this->_getParam('class'), 'payment');
$paymentsFilterData = array();
$payments = array();
foreach ($cc as $k => $c) {
$payments[$k] = Kwf_Trl::getInstance()->trlStaticExecute(Kwc_Abstract::getSetting($c, 'componentName'));
$paymentsFilterData[] = array($k, $payments[$k]);
}
$this->_filters['text'] = true;
if (count($payments) > 1) {
$this->_filters['payment'] = array('type' => 'ComboBox', 'text' => trlKwf('Payment'), 'data' => $paymentsFilterData, 'width' => 100);
}
$this->_filters['canceled'] = array('type' => 'Button', 'skipWhere' => true, 'cls' => 'x2-btn-text-icon', 'icon' => '/assets/silkicons/stop.png', 'text' => trlKwf('canceled'), 'tooltip' => trlKwf('Show canceled orders'));
$this->_filters['shipped'] = array('type' => 'Button', 'skipWhere' => true, 'cls' => 'x2-btn-text-icon', 'icon' => '/assets/silkicons/package.png', 'text' => trlKwf('shipped'), 'tooltip' => trlKwf('Show shipped orders'));
$this->_columns->add(new Kwf_Grid_Column('order_number', trlKwf('Order Nr'), 50));
$this->_columns->add(new Kwf_Grid_Column('invoice_number', trlKwf('Invoice Nr'), 50))->setHidden(true);
$this->_columns->add(new Kwf_Grid_Column_Datetime('date', trlKwf('Date')));
$this->_columns->add(new Kwf_Grid_Column('firstname', trlKwf('Firstname'), 90));
$this->_columns->add(new Kwf_Grid_Column('lastname', trlKwf('Lastname'), 90));
$this->_columns->add(new Kwf_Grid_Column('country', trlKwf('Country'), 15));
// TODO: Pfusch
$this->_columns->add(new Kwf_Grid_Column('sum_amount', trlKwf('Amt'), 30))->setData(new Kwc_Shop_Cart_Checkout_OrdersController_SumAmount())->setSortable(false);
$this->_columns->add(new Kwf_Grid_Column('sum_price', trlKwf('Sum'), 50))->setData(new Kwc_Shop_Cart_Checkout_OrdersController_SumPrice())->setSortable(false)->setRenderer('euroMoney');
if (count($payments) > 1) {
$this->_columns->add(new Kwf_Grid_Column('payment', trlKwf('Payment'), 80))->setData(new Kwc_Shop_Cart_Checkout_OrdersController_Payment($payments))->setSortable(false);
}
$this->_columns->add(new Kwf_Grid_Column_Date('payed', trlKwf('Payed')));
if (Kwc_Abstract::getSetting($this->_getParam('class'), 'generateInvoices')) {
$this->_columns->add(new Kwf_Grid_Column_Button('invoice', trlcKwf('Invoice', 'IN')));
}
$this->_columns->add(new Kwf_Grid_Column_Button('shipped', trlcKwf('Shipped', 'SH')))->setButtonIcon('/assets/silkicons/package_go.png');
$this->_columns->add(new Kwf_Grid_Column('shipped'));
}
示例7: callModifyItemData
public final function callModifyItemData(Kwf_Component_Data $item)
{
foreach (Kwc_Abstract::getChildComponentClasses($this->getData()->componentClass) as $c) {
if (Kwc_Abstract::hasSetting($c, 'hasModifyItemData') && Kwc_Abstract::getSetting($c, 'hasModifyItemData')) {
call_user_func(array(strpos($c, '.') ? substr($c, 0, strpos($c, '.')) : $c, 'modifyItemData'), $item, $c);
}
}
}
示例8: _getComponentClassByRow
protected function _getComponentClassByRow($row)
{
$classes = Kwc_Abstract::getChildComponentClasses($this->_componentClass, $this->_generatorKey);
if (!$row->getModel()->hasColumn('component') || !$row->component) {
return reset($classes);
}
return $classes[$row->component];
}
示例9: getListeners
public function getListeners()
{
$ret = parent::getListeners();
foreach (Kwc_Abstract::getChildComponentClasses($this->_class, 'child') as $class) {
$ret[] = array('class' => $class, 'event' => 'Kwf_Component_Event_Component_ContentChanged', 'callback' => 'onChildContentChanged');
}
return $ret;
}
示例10: testFilename
public function testFilename()
{
$ccc = Kwc_Abstract::getChildComponentClasses('Kwf_Component_Generator_Page_Root', array('filename' => 'home'));
$this->assertEquals(2, count($ccc));
$this->assertEquals('Kwc_Basic_None_Component', current($ccc));
$children = $this->_root->getChildComponents(array('filename' => 'home'));
$this->assertEquals(1, count($children));
$child = $this->_root->getChildComponent(array('filename' => 'home'));
$this->assertEquals('1', $child->componentId);
$child = $child->getChildComponent(array('filename' => 'foo'));
$this->assertEquals('2', $child->componentId);
}
示例11: _getCreatingClasses
/**
* Returns all component classes that can create $createdClass. Optionally filtering instances of $createClass.
*/
protected function _getCreatingClasses($createdClass, $createClass = null)
{
$ret = array();
foreach (Kwc_Abstract::getComponentClasses() as $c) {
if (!$createClass || in_array($createClass, Kwc_Abstract::getParentClasses($c))) {
if (Kwc_Abstract::getChildComponentClasses($c, array('componentClass' => $createdClass))) {
$ret[] = $c;
}
}
}
return $ret;
}
示例12: _canCreateUsIndirectly
private function _canCreateUsIndirectly($class)
{
foreach (Kwc_Abstract::getChildComponentClasses($class, array('generatorFlags' => array('static' => true))) as $c) {
if ($c == $this->_class) {
return true;
}
if ($this->_canCreateUsIndirectly($c)) {
return true;
}
}
return false;
}
示例13: getListeners
public function getListeners()
{
$ret = parent::getListeners();
foreach (Kwc_Abstract::getComponentClasses() as $class) {
foreach (Kwc_Abstract::getChildComponentClasses($class) as $childClass) {
if ($childClass == $this->_class) {
$ret[] = array('class' => $class, 'event' => 'Kwf_Component_Event_ComponentClass_ContentChanged', 'callback' => 'onParentContentChanged');
$ret[] = array('class' => $class, 'event' => 'Kwf_Component_Event_ComponentClass_AllPartialChanged', 'callback' => 'onParentPartialsChanged');
}
}
}
return $ret;
}
示例14: _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);
}
}
}
}
}
示例15: _findDimensionByChildComponentClassRecursive
private static function _findDimensionByChildComponentClassRecursive($class)
{
$parents = Kwc_Abstract::getSetting($class, 'parentClasses');
if (in_array('Kwc_Basic_ImageEnlarge_EnlargeTag_Component', $parents)) {
return Kwc_Abstract::getSetting($class, 'dimension');
} else {
foreach (Kwc_Abstract::getChildComponentClasses($class) as $childClass) {
$dimension = self::_findDimensionByChildComponentClassRecursive($childClass);
if ($dimension) {
return $dimension;
}
}
}
return false;
}