예제 #1
0
// Current alias object to manipulate
if ($aliasId) {
    $item = CMS_module_cms_aliases::getByID($aliasId);
    if (io::isPositiveInteger($item->getParent())) {
        $parentAlias = CMS_module_cms_aliases::getByID($item->getParent());
    }
} else {
    $item = new CMS_resource_cms_aliases();
    if (io::isPositiveInteger($fatherId)) {
        // Parent alias
        $parentAlias = CMS_module_cms_aliases::getByID($fatherId);
    }
}
$items = array();
$selectContent = array();
$aliases = CMS_module_cms_aliases::getAll(false, true);
foreach ($aliases as $alias) {
    if ($alias->getID() != $item->getID() && !$alias->hasParent($item->getID())) {
        $lineage = $alias->getPath();
        $selectContent[$lineage] = array($alias->getID(), $lineage);
    }
}
ksort($selectContent);
array_unshift($selectContent, array(0, '/'));
$selectContent = sensitiveIO::jsonEncode(array_values($selectContent));
$controlerURL = PATH_ADMIN_MODULES_WR . '/' . $codename . '/controler.php';
$parentId = isset($parentAlias) && is_object($parentAlias) ? $parentAlias->getId() : 0;
//mandatory
$mandatory = '<span class="atm-red">*</span> ';
//create pseudo href for redirection infos
$href = new CMS_href();
예제 #2
0
$module = CMS_modulesCatalog::getByCodename($codename);
if (!$module) {
    CMS_grandFather::raiseError('Unknown module or module for codename : ' . $codename);
    $view->show();
}
//CHECKS user has module clearance
if (!$cms_user->hasModuleClearance($codename, CLEARANCE_MODULE_EDIT)) {
    CMS_grandFather::raiseError('User has no rights on module : ' . $codename);
    $view->setActionMessage($cms_language->getmessage(MESSAGE_ERROR_MODULE_RIGHTS, array($module->getLabel($cms_language))));
    $view->show();
}
//get queried module aliases
if ($pageId) {
    $aliases = CMS_module_cms_aliases::getAllByPage($rootId, $pageId, true);
} else {
    $aliases = CMS_module_cms_aliases::getAll($rootId, true);
}
$nodes = array();
foreach ($aliases as $alias) {
    $hasSiblings = $alias->hasSubAliases();
    if ($alias->hasError()) {
        $label = ($alias->getWebsites() ? '<span style="color:red;">*</span>' : '') . '<span style="color:red;">' . $alias->getAlias() . '</span>';
    } elseif ($pageId && $alias->getPageID() == $pageId && $alias->urlReplaced()) {
        $label = ($alias->getWebsites() ? '<span style="color:red;">*</span>' : '') . '<span style="color:green;">' . $alias->getAlias() . '</span>';
    } else {
        $label = ($alias->getWebsites() ? '<span style="color:red;">*</span>' : '') . $alias->getAlias();
    }
    if ($alias->hasError()) {
        $qtip = '<span style="color:red;"><strong>' . $cms_language->getMessage(MESSAGE_PAGE_ALIAS_ERROR, false, 'cms_aliases') . '</strong></span><br />';
    } else {
        $qtip = $cms_language->getMessage(MESSAGE_PAGE_ALIAS, false, 'cms_aliases') . ' <strong>' . $alias->getPath() . '</strong><br />';