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); }
private function _checkRowIndependence(Kwf_Model_Row_Interface $row, $msgMethod) { $c = Kwf_Component_Data_Root::getInstance()->getComponentByDbId($this->_getParam('componentId')); // wenn zB Newsletter statisch in root erstellt wurde, gibts kein visible if (!$c) { //wenn seite offline ist ignorieren // ist nicht natürlich nicht korrekt, wir *müssten* die überprüfung // nachholen, sobald die seite online gestellt wird return; } $components = array(); foreach (Kwc_Admin::getDependsOnRowInstances() as $a) { if ($a instanceof Kwf_Component_Abstract_Admin_Interface_DependsOnRow) { $components = array_merge($components, $a->getComponentsDependingOnRow($row)); } } $g = Kwc_Abstract::getSetting($this->_getParam('class'), 'generators'); if (isset($g['detail']['dbIdShortcut'])) { //wenn auf sich selbst verlinkt ignorieren foreach ($components as $k => &$c) { $c = $c->getPage(); $news = Kwf_Component_Data_Root::getInstance()->getComponentsByDbId($g['detail']['dbIdShortcut'] . $row->id); foreach ($news as $n) { if ($c->componentId == $n->getPage()->componentId) { unset($components[$k]); } } } } if ($components) { $msg = trlKwf("You can not {0} this entry as it is used on the following pages:", $msgMethod); $msg .= Kwf_Util_Component::getHtmlLocations($components); throw new Kwf_ClientException($msg); } }