本文整理汇总了PHP中Kwc_Abstract::getParentClasses方法的典型用法代码示例。如果您正苦于以下问题:PHP Kwc_Abstract::getParentClasses方法的具体用法?PHP Kwc_Abstract::getParentClasses怎么用?PHP Kwc_Abstract::getParentClasses使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kwc_Abstract
的用法示例。
在下文中一共展示了Kwc_Abstract::getParentClasses方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getListeners
public function getListeners()
{
$ret = parent::getListeners();
//find components that can create ourself ($this->_class)
foreach ($this->_getCreatingClasses($this->_class) as $class) {
$ret[] = array('class' => $class, 'event' => 'Kwf_Events_Event_Media_Changed', 'callback' => 'onMediaChanged');
$ret[] = array('class' => $class, 'event' => 'Kwf_Component_Event_Component_ContentChanged', 'callback' => 'onContentChanged');
$ret[] = array('class' => $class, 'event' => 'Kwf_Component_Event_ComponentClass_ContentChanged', 'callback' => 'onClassContentChanged');
$imageEnlargeClasses = array();
foreach ($this->_getCreatingClasses($class) as $c) {
if (in_array('Kwc_Basic_LinkTag_Component', Kwc_Abstract::getParentClasses($c))) {
$imageEnlargeClasses = array_merge($imageEnlargeClasses, $this->_getCreatingClasses($c));
} else {
$imageEnlargeClasses[] = $c;
}
}
foreach ($imageEnlargeClasses as $imageEnlargeClass) {
// TODO: does not cover "List_Switch with ImageEnlarge as large component (we have to go up one more level)"
foreach ($this->_getCreatingClasses($imageEnlargeClass, null) as $listClass) {
if (!is_instance_of($listClass, 'Kwc_Abstract_List_Component')) {
$listClasses = $this->_getCreatingClasses($listClass, 'Kwc_Abstract_List_Component');
} else {
$listClasses = array($listClass);
}
foreach ($listClasses as $listClass) {
$ret[] = array('class' => $listClass, 'event' => 'Kwc_Abstract_List_EventItemDeleted', 'callback' => 'onListItemChange');
$ret[] = array('class' => $listClass, 'event' => 'Kwc_Abstract_List_EventItemInserted', 'callback' => 'onListItemChange');
$ret[] = array('class' => $listClass, 'event' => 'Kwc_Abstract_List_EventItemUpdated', 'callback' => 'onListItemChange');
}
}
}
}
return $ret;
}
示例2: _formatConfig
protected function _formatConfig($parentData, $row)
{
$ret = parent::_formatConfig($parentData, $row);
$parentClasses = Kwc_Abstract::getParentClasses($parentData->componentClass);
if (in_array('Kwc_Chained_CopyTarget_Component', $parentClasses)) {
$ret['parent'] = $parentData;
}
return $ret;
}
示例3: getListeners
public function getListeners()
{
$ret = parent::getListeners();
foreach (Kwc_Abstract::getComponentClasses() as $class) {
if (in_array('Kwc_Advanced_SearchEngineReferer_Component', Kwc_Abstract::getParentClasses($class))) {
$m = Kwc_Abstract::createChildModel($class);
$ret[] = array('class' => $m, 'event' => 'Kwf_Events_Event_Row_Inserted', 'callback' => 'onRowInsert');
}
}
return $ret;
}
示例4: _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;
}
示例5: 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;
}
示例6: _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));
}
}
}
示例7: getComponentClassesByParentClass
/**
* Returns componentClasses that match a given class in their inheritance chain
*
* Fast, as the result is static and will be cached
*
* @param string
* @return string[]
*/
public static function getComponentClassesByParentClass($class)
{
if (!is_array($class)) {
$class = array($class);
}
static $prefix;
$cacheId = 'cclsbpc-' . implode('-', $class);
$ret = Kwf_Cache_SimpleStatic::fetch($cacheId, $success);
if ($success) {
return $ret;
}
$ret = array();
foreach (Kwc_Abstract::getComponentClasses() as $c) {
if (in_array($c, $class) || in_array(strpos($c, '.') ? substr($c, 0, strpos($c, '.')) : $c, $class)) {
$ret[] = $c;
continue;
}
foreach (Kwc_Abstract::getParentClasses($c) as $p) {
if (in_array($p, $class)) {
$ret[] = $c;
break;
}
}
}
Kwf_Cache_SimpleStatic::add($cacheId, $ret);
return $ret;
}
示例8: _processComponentDependency
private function _processComponentDependency($assetsType, $class, $rootComponent, $includeAdminAssets)
{
if (in_array($assetsType . $class . $includeAdminAssets, $this->_processedComponents)) {
return;
}
array_push($this->_stack, $class);
$assets = Kwc_Abstract::getSetting($class, 'assets');
$assetsAdmin = array();
if ($includeAdminAssets) {
$assetsAdmin = Kwc_Abstract::getSetting($class, 'assetsAdmin');
}
$this->_processedComponents[] = $assetsType . $class . $includeAdminAssets;
if (isset($assets['dep'])) {
foreach ($assets['dep'] as $dep) {
$this->_processDependency($assetsType, $dep, $rootComponent);
}
}
if (isset($assetsAdmin['dep'])) {
foreach ($assetsAdmin['dep'] as $dep) {
$this->_processDependency($assetsType, $dep, $rootComponent);
}
}
if (isset($assets['files'])) {
foreach ($assets['files'] as $file) {
$this->_processDependencyFile($assetsType, $file, $rootComponent);
}
}
if (isset($assetsAdmin['files'])) {
foreach ($assetsAdmin['files'] as $file) {
$this->_processDependencyFile($assetsType, $file, $rootComponent);
}
}
//alle css-dateien der vererbungshierache includieren
$componentCssFiles = array();
foreach (Kwc_Abstract::getParentClasses($class) as $c) {
$curClass = $c;
if (substr($curClass, -10) == '_Component') {
$curClass = substr($curClass, 0, -10);
}
$curClass = $curClass . '_Component';
$file = str_replace('_', '/', $curClass);
foreach ($this->_config->path as $type => $dir) {
if ($dir == '.') {
$dir = getcwd();
}
if (is_file($dir . '/' . $file . '.css')) {
$f = $type . '/' . $file . '.css';
$this->_processDependencyFile($assetsType, $f);
}
if (is_file($dir . '/' . $file . '.printcss')) {
$f = $type . '/' . $file . '.printcss';
$this->_processDependencyFile($assetsType, $f);
}
}
}
$classes = Kwc_Abstract::getChildComponentClasses($class);
$classes = array_merge($classes, Kwc_Abstract::getSetting($class, 'plugins'));
foreach ($classes as $class) {
if ($class) {
$this->_processComponentDependency($assetsType, $class, $rootComponent, $includeAdminAssets);
}
}
array_pop($this->_stack);
}