本文整理汇总了PHP中Kwc_Admin::getDependsOnRowInstances方法的典型用法代码示例。如果您正苦于以下问题:PHP Kwc_Admin::getDependsOnRowInstances方法的具体用法?PHP Kwc_Admin::getDependsOnRowInstances怎么用?PHP Kwc_Admin::getDependsOnRowInstances使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kwc_Admin
的用法示例。
在下文中一共展示了Kwc_Admin::getDependsOnRowInstances方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
示例2: _checkRowIndependence
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);
}
}