本文整理汇总了PHP中Kwc_Admin类的典型用法代码示例。如果您正苦于以下问题:PHP Kwc_Admin类的具体用法?PHP Kwc_Admin怎么用?PHP Kwc_Admin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Kwc_Admin类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: indexAction
public function indexAction()
{
parent::indexAction();
$cfg = Kwc_Admin::getInstance($this->_getParam('class'))->getExtConfig();
$this->view->assign($cfg['grid']);
unset($this->view->title);
}
示例3: 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;
}
示例4: 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');
}
示例5: _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();
}
示例6: 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');
}
示例7: 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;
}
示例8: getComponentsDependingOnRow
public function getComponentsDependingOnRow()
{
$ret = array();
foreach (Kwc_Admin::getDependsOnRowInstances() as $a) {
foreach ($a->getComponentsDependingOnRow($this) as $i) {
if ($i) {
$ret[] = $i;
}
}
}
//unterseiten
foreach ($this->getChildNodes() as $c) {
$ret = array_merge($ret, $c->getComponentsDependingOnRow());
}
//rekursive links ignorieren
foreach ($ret as $k => $r) {
while ($r) {
if ($r->componentId == $this->id) {
unset($ret[$k]);
break;
}
$r = $r->parent;
}
}
return array_values($ret);
}
示例9: 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;
}
示例10: _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);
}
示例11: _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);
}
}
示例12: __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);
}
示例13: 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;
}
示例14: _getConfig
protected function _getConfig()
{
$config = $this->_getStandardConfig('kwc.advanced.downloadstree');
$config['projectsUrl'] = Kwc_Admin::getInstance($this->_class)->getControllerUrl('Projects');
$config['projectUrl'] = Kwc_Admin::getInstance($this->_class)->getControllerUrl('Project');
$config['downloadsUrl'] = Kwc_Admin::getInstance($this->_class)->getControllerUrl('Downloads');
return array('customerarea' => $config);
}
示例15: _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');
}