本文整理汇总了PHP中Kwc_Admin::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP Kwc_Admin::getInstance方法的具体用法?PHP Kwc_Admin::getInstance怎么用?PHP Kwc_Admin::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kwc_Admin
的用法示例。
在下文中一共展示了Kwc_Admin::getInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _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);
}
}
示例2: indexAction
public function indexAction()
{
Kwf_Util_MemoryLimit::set(1024);
set_time_limit(0);
$source = Kwf_Component_Data_Root::getInstance()->getComponentByDbId($this->_getParam('source'), array('ignoreVisible' => true));
if (!$source) {
throw new Kwf_Exception_Client("source not found");
}
$target = Kwf_Component_Data_Root::getInstance()->getComponentByDbId($this->_getParam('target'), array('ignoreVisible' => true));
if (!$target) {
throw new Kwf_Exception_Client("target not found");
}
Kwf_Events_ModelObserver::getInstance()->disable();
//This would be slow as hell. But luckily we can be sure that for the new (duplicated) components there will be no view cache to clear.
Kwf_Registry::get('db')->beginTransaction();
echo "counting pages...";
$steps = Kwc_Admin::getInstance($source->componentClass)->getDuplicateProgressSteps($source);
echo " " . $steps . "\n";
$ad = new Zend_ProgressBar_Adapter_Console();
$ad->setElements(array(Zend_ProgressBar_Adapter_Console::ELEMENT_BAR, Zend_ProgressBar_Adapter_Console::ELEMENT_TEXT, Zend_ProgressBar_Adapter_Console::ELEMENT_ETA));
$progressBar = new Zend_ProgressBar($ad, 0, $steps);
Kwc_Admin::getInstance($source->componentClass)->duplicate($source, $target, $progressBar);
Kwf_Util_Component::afterDuplicate($source, $target);
$progressBar->finish();
Kwf_Registry::get('db')->commit();
exit;
}
示例3: __construct
public function __construct($resourceId, $menuConfig = null, $menuUrl = null, Kwf_Component_Data $component = null)
{
if ($resourceId instanceof Kwf_Component_Data) {
$component = $resourceId;
$resourceId = 'kwc_' . $component->dbId;
} else {
if (!$component) {
throw new Kwf_Exception("component parameter is required");
}
}
$this->_component = $component;
if (!$menuConfig) {
if (Kwc_Abstract::hasSetting($this->_class, 'componentNameShort')) {
$name = Kwc_Abstract::getSetting($this->_class, 'componentNameShort');
} else {
$name = Kwc_Abstract::getSetting($this->_class, 'componentName');
}
$icon = Kwc_Abstract::getSetting($component->componentClass, 'componentIcon');
$menuConfig = array('text' => trlKwfStatic('Edit {0}', $name), 'icon' => $icon);
}
if (!$menuUrl) {
$menuUrl = Kwc_Admin::getInstance($component->componentClass)->getControllerUrl() . '?componentId=' . $component->dbId;
}
parent::__construct($resourceId, $menuConfig, $menuUrl);
}
示例4: _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);
}
示例5: addResources
public function addResources(Kwf_Acl $acl)
{
parent::addResources($acl);
$name = Kwc_Abstract::getSetting($this->_class, 'componentName');
$icon = Kwc_Abstract::getSetting($this->_class, 'componentIcon');
$acl->add(new Kwf_Acl_Resource_ComponentClass_MenuUrl($this->_class, array('text' => $name, 'icon' => $icon), Kwc_Admin::getInstance($this->_class)->getControllerUrl()), 'kwf_component_root');
}
示例6: _initColumns
protected function _initColumns()
{
$this->_columns->add(new Kwf_Grid_Column('id'));
$this->_columns->add(new Kwf_Grid_Column('name'));
if ($this->_getParam('id')) {
$subRootComponentId = $this->_getParam('id');
} else {
if ($this->_getParam('parent_id')) {
$subRootComponentId = $this->_getParam('parent_id');
} else {
if ($this->_getParam('componentId')) {
$subRootComponentId = $this->_getParam('componentId');
} else {
throw new Kwf_Exception("componentId, id or parent_id required");
}
}
}
$data = array();
$gen = Kwc_Abstract::getSetting($this->_getParam('class'), 'generators');
foreach ($gen['child']['component'] as $name => $class) {
if (!$class) {
continue;
}
$admin = Kwc_Admin::getInstance($class);
$forms = $admin->getCardForms();
foreach ($admin->getVisibleCardForms($subRootComponentId) as $k) {
$id = count($forms) == 1 ? $name : $name . '_' . $k;
$data[] = array('id' => $id, 'name' => $forms[$k]['title']);
}
}
$this->_model = new Kwf_Model_FnF(array('data' => $data));
parent::_initColumns();
}
示例7: indexAction
public function indexAction()
{
parent::indexAction();
$cfg = Kwc_Admin::getInstance($this->_getParam('class'))->getExtConfig();
$this->view->assign($cfg['grid']);
unset($this->view->title);
}
示例8: getTemplateVars
public function getTemplateVars(Kwf_Component_Renderer_Abstract $renderer)
{
$ret = parent::getTemplateVars($renderer);
$ret['paypalButton'] = $this->_getPaypalButton();
$ret['options'] = array('controllerUrl' => Kwc_Admin::getInstance($this->getData()->componentClass)->getControllerUrl() . '/json-confirm-order', 'params' => array('paymentComponentId' => $this->getData()->parent->componentId));
return $ret;
}
示例9: addResources
public function addResources(Kwf_Acl $acl)
{
if (!$acl->has('kwc_shop')) {
$acl->add(new Kwf_Acl_Resource_MenuDropdown('kwc_shop', array('text' => trlKwfStatic('Shop'), 'icon' => 'cart.png')), 'kwf_component_root');
}
$acl->add(new Kwf_Acl_Resource_ComponentClass_MenuUrl($this->_class, array('text' => trlKwfStatic('Vouchers'), 'icon' => 'application_view_list.png'), Kwc_Admin::getInstance($this->_class)->getControllerUrl('Vouchers')), 'kwc_shop');
}
示例10: load
public function load($row, array $info = array())
{
$gen = Kwf_Component_Generator_Abstract::getInstance($this->_componentClass, $this->_generatorKey);
$edit = Kwf_Component_Abstract_ExtConfig_Abstract::getEditConfigs($this->_getComponentClassByRow($row), $gen, '{componentId}-{0}', '');
$this->_componentConfigs = array_merge($this->_componentConfigs, $edit['componentConfigs']);
$ret = $edit['contentEditComponents'];
$g = Kwc_Abstract::getSetting($this->_componentClass, 'generators');
if (isset($g['detail']['dbIdShortcut'])) {
$dbId = $g['detail']['dbIdShortcut'] . $row->id;
} else {
$dbId = $row->component_id . $gen->getIdSeparator() . $row->id;
}
$components = Kwf_Component_Data_Root::getInstance()->getComponentsByDbId($dbId, array('ignoreVisible' => true));
if (isset($components[0])) {
foreach (Kwf_Controller_Action_Component_PagesController::getSharedComponents($components[0]) as $cls => $cmp) {
$cfg = Kwc_Admin::getInstance($cls)->getExtConfig(Kwf_Component_Abstract_ExtConfig_Abstract::TYPE_SHARED);
foreach ($cfg as $k => $c) {
if (!isset($this->_componentConfigs[$cls . '-' . $k])) {
$this->_componentConfigs[$cls . '-' . $k] = $c;
}
$ret[] = array('componentClass' => $cls, 'type' => $k, 'idTemplate' => '{componentId}-{0}', 'componentIdSuffix' => '');
}
}
}
return $ret;
}
示例11: getTemplateVars
public function getTemplateVars()
{
$ret = parent::getTemplateVars();
$ret['wirecardButton'] = $this->_getWirecardButton();
$ret['options'] = array('controllerUrl' => Kwc_Admin::getInstance(get_class($this))->getControllerUrl() . '/json-confirm-order', 'params' => array('paymentComponentId' => $this->getData()->parent->componentId));
return $ret;
}
示例12: preDispatch
public function preDispatch()
{
$this->setModel(new Kwc_Directories_Item_Directory_Trl_AdminModel(array('proxyModel' => Kwc_Abstract::createChildModel(Kwc_Abstract::getSetting($this->_getParam('class'), 'masterComponentClass')), 'trlModel' => Kwc_Abstract::createChildModel($this->_getParam('class')))));
parent::preDispatch();
$url = Kwc_Admin::getInstance($this->_getParam('class'))->getControllerUrl('Form');
$this->_editDialog['controllerUrl'] = $url;
}
示例13: _initColumns
protected function _initColumns()
{
$this->_editDialog = array('controllerUrl' => Kwc_Admin::getInstance($this->_getParam('class'))->getControllerUrl('OrderProduct'), 'width' => 400, 'height' => 250);
$this->_columns->add(new Kwf_Grid_Column('product', trlKwf('Product')))->setData(new Kwc_Shop_Cart_Checkout_ProductData_ProductText());
$this->_columns->add(new Kwf_Grid_Column('amount', trlKwf('Amount'), 50))->setData(new Kwc_Shop_Cart_Checkout_ProductData_Amount());
$this->_columns->add(new Kwf_Grid_Column('info', trlKwf('Info'), 150))->setData(new Kwc_Shop_Cart_Checkout_ProductData_Info());
$this->_columns->add(new Kwf_Grid_Column('price', trlKwf('Price'), 50))->setData(new Kwc_Shop_Cart_Checkout_ProductData_Price())->setRenderer('money');
}
示例14: _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());
}
示例15: indexAction
public function indexAction()
{
$config = Kwc_Admin::getInstance($this->_getParam('class'))->getExtConfig();
$config = $config['customerarea'];
$config['baseParams']['componentId'] = $this->_getParam('componentId');
$this->view->assign($config);
$this->view->baseParams = array('componentId' => $this->_getParam('componentId'));
}