private function _checkRowIndependence(Kwf_Model_Row_Interface $row, $msgMethod)
 {
     if (!$row instanceof Kwc_Root_Category_GeneratorRow) {
         return;
     }
     $m = Kwf_Model_Abstract::getInstance('Kwc_Root_Category_GeneratorModel');
     $pageRow = $m->getRow($row->getData()->row->id);
     $r = $pageRow;
     while ($r) {
         if (!$r->visible) {
             //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;
         }
         $r = $r->getParentNode();
     }
     $components = $pageRow->getComponentsDependingOnRow();
     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);
     }
 }
Пример #2
0
 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);
     }
 }