/** * Wert für die Ausgabe */ function matchCategory($content, $replaceInTemplate = false) { global $REX; $var = 'REX_CATEGORY'; $matches = $this->getVarParams($content, $var); foreach ($matches as $match) { list($param_str, $args) = $match; list($category_id, $args) = $this->extractArg('id', $args, 0); list($clang, $args) = $this->extractArg('clang', $args, '$REX[\'CUR_CLANG\']'); list($field, $args) = $this->extractArg('field', $args, ''); $tpl = ''; if ($category_id == 0) { // REX_CATEGORY[field=name] feld von aktueller kategorie verwenden if (OOCategory::hasValue($field)) { // bezeichner wählen, der keine variablen // aus modulen/templates überschreibt // beachte: root-artikel haben keine kategorie $varname_art = '$__rex_art'; $varname_cat = '$__rex_cat'; $tpl = '<?php ' . $varname_art . ' = OOArticle::getArticleById($REX[\'ARTICLE_ID\'], ' . $clang . '); ' . $varname_cat . ' = ' . $varname_art . '->getCategory(); if(' . $varname_cat . ') echo htmlspecialchars(' . $this->handleGlobalVarParamsSerialized($var, $args, $varname_cat . '->getValue(\'' . addslashes($field) . '\')') . '); ?>'; } } else { if ($category_id > 0) { // REX_CATEGORY[field=name id=5] feld von gegebene category_id verwenden if ($field) { if (OOCategory::hasValue($field)) { // bezeichner wählen, der keine variablen // aus modulen/templates überschreibt $varname = '$__rex_cat'; $tpl = '<?php ' . $varname . ' = OOCategory::getCategoryById(' . $category_id . ', ' . $clang . '); if(' . $varname . ') echo htmlspecialchars(' . $this->handleGlobalVarParamsSerialized($var, $args, $varname . '->getValue(\'' . addslashes($field) . '\')') . '); ?>'; } } } } if ($tpl != '') { $content = str_replace($var . '[' . $param_str . ']', $tpl, $content); } } return $content; }
function navi() { echo "<ul>"; // start HTML-List $max_depth = 3; // max nesting-depth root is depth=0 $inc_art = true; // include articles $inc_root_art = false; // include root articles $inc_start_art = false; // include start article $config = array($max_depth, $inc_art, $inc_start_art, $inc_root_art); // config array $items = []; // wrapper for subitem sizes $count = 0; // items per nesting level foreach (OOCategory::getRootCategories() as $item) { if (!$item->isOnline()) { continue; } $count++; // initalize each root-item // print root-item echo '<li><a href="' . $item->getUrl() . '" title="' . $item->getName() . '">' . $item->getName() . '</a></li>'; $d = 0; // set nesting-depth for root-item getSubItems($item, $d, $config); $d = 0; // REset nesting-depth for root-item } // get Root Articles if (sizeof(OOArticle::getRootArticles()) >= 1 && $config[3]) { foreach (OOArticle::getRootArticles() as $art) { if (!$art->isOnline()) { continue; } echo '<li><a href="' . $art->getUrl() . '" title="' . $art->getName() . '">' . $art->getName() . '</a></li>'; } } echo "</ul>"; }
function rex_a62_metainfo_button($params) { global $REX, $I18N; $s = ''; $restrictionsCondition = ''; if (isset($params['id']) && $params['id'] != '') { $OOCat = OOCategory::getCategoryById($params['id']); // Alle Metafelder des Pfades sind erlaubt foreach (explode('|', $OOCat->getPath()) as $pathElement) { if ($pathElement != '') { $s .= ' OR `p`.`restrictions` LIKE "%|' . $pathElement . '|%"'; } } // Auch die Kategorie selbst kann Metafelder haben $s .= ' OR `p`.`restrictions` LIKE "%|' . $params['id'] . '|%"'; } $restrictionsCondition = 'AND (`p`.`restrictions` = ""' . $s . ')'; $fields = _rex_a62_metainfo_sqlfields('cat_', $restrictionsCondition); if ($fields->getRows() >= 1) { $return = '<p class="rex-button-add"><script type="text/javascript"><!-- function rex_metainfo_toggle() { jQuery("#rex-form-structure-category .rex-metainfo-cat").toggle(); metacat = jQuery("#rex-i-meta-category"); if(metacat.hasClass("rex-i-generic-open")) { metacat.removeClass("rex-i-generic-open"); metacat.addClass("rex-i-generic-close"); } else { metacat.removeClass("rex-i-generic-close"); metacat.addClass("rex-i-generic-open"); } } //--></script><a id="rex-i-meta-category" class="rex-i-generic-open" href="javascript:rex_metainfo_toggle();">' . $I18N->msg('minfo_edit_metadata') . '</a></p>'; return $params['subject'] . $return; } return $params['subject']; }
function hasCategoryPerm($category_id, $depricatedSecondParam = null) { // 1. Volle Rechte auf direkte Kategorie, csw // 2. Leserechte, bei Kategorien "zwischen" main und eigener navi, aber nicht sichtbar, csr // 3. Volle Rechte, wenn Kategorie unterhalb eine vollen Rechte Kat if ($this->isAdmin() || $this->hasPerm('csw[0]') || $this->hasPerm('csw[' . $category_id . ']')) { return true; } if ($c = OOCategory::getCategoryById($category_id)) { foreach ($c->getPathAsArray() as $k) { if ($this->hasPerm('csw[' . $k . ']')) { return true; } } } /*if(!$rw) { if( $this->hasPerm('csr[' . $category_id . ']') ) return TRUE; } */ return false; }
<div id="rex-linkmap"> <div class="rex-area-col-2"> <div class="rex-area-col-a"> <h3 class="rex-hl2"><?php echo $I18N->msg('lmap_categories'); ?> </h3> <div class="rex-area-content"> <?php $roots = OOCategory::getRootCategories(); $mountpoints = $REX['USER']->getMountpoints(); if (count($mountpoints) > 0) { $roots = array(); foreach ($mountpoints as $mp) { if (OOCategory::getCategoryById($mp)) { $roots[] = OOCategory::getCategoryById($mp); } } } echo rex_linkmap_tree($tree, $category_id, $roots, $GlobalParams); ?> </div> </div> <div class="rex-area-col-b"> <h3 class="rex-hl2"><?php echo $I18N->msg('lmap_articles'); ?> </h3> <div class="rex-area-content"> <ul>
static function getListValue($params) { $return = array(); foreach (explode(',', $params['value']) as $id) { if ($cat = OOCategory::getCategoryById($id, (int) $params['params']['field']['clang'])) { $return[] = $cat->getName(); } } return implode('<br />', $return); }
function &_getCategoryObject($category, $clang = false) { if (is_object($category)) { return $category; } elseif (is_int($category)) { return OOCategory::getCategoryById($category, $clang); } elseif (is_array($category)) { $catlist = array(); foreach ($category as $cat) { $catobj = OOCategory::_getCategoryObject($cat, $clang); if (is_object($catobj)) { $catlist[] = $catobj; } else { return null; } } return $catlist; } return null; }
/** * Gibt die URL der Terminkategorie zurück. * @global mixed[] $REX Redaxo Variable * @var boolean $path_only Gibt an, ob die URL mit Domain oder ohne erstellt * werden soll. * @return String URL für das Objekt */ function getURL($path_only = FALSE) { if ($this->url == "") { global $REX; $pathname = ''; if (OOAddon::isActivated('seo42')) { // Mit SEO42 require_once dirname(__FILE__) . "/../../seo42/classes/class.seo42_rewrite.inc.php"; // Dann Redaxo Artikelfolge if ($REX['ADDON']['d2u_kurse']['settings']['kurse_artikel'] > 0 && $REX['ADDON']['d2u_kurse']['settings']['kurse_artikel'] != $REX['START_ARTICLE_ID']) { $kategorie = OOCategory::getCategoryById($REX['ADDON']['d2u_kurse']['settings']['kurse_artikel'], $REX['CUR_CLANG']); $hauptkategorien = $kategorie->getPathAsArray(); for ($i = 0; $i < count($hauptkategorien); $i++) { $hauptkategorie = OOCategory::getCategoryById($hauptkategorien[$i], $REX['CUR_CLANG']); if ($hauptkategorie instanceof OOCategory) { $pathname = seo42_appendToPath($pathname, $hauptkategorie->getName(), $hauptkategorie->getId(), $REX['CUR_CLANG']); } } if ($kategorie->getName() != "") { $pathname = seo42_appendToPath($pathname, $kategorie->getName(), $kategorie->getId(), $REX['CUR_CLANG']); } else { // Wenn angegebener Artikel keine Kategorie ist, sondern nur Artikelname hat $pathname = seo42_appendToPath($pathname, $kategorie->getValue("name"), $kategorie->getId(), $REX['CUR_CLANG']); } } // Art der Startkachel $pathname = seo42_appendToPath($pathname, $REX['ADDON']['d2u_kurse']['settings']['termin_titel'], $REX['ADDON']['d2u_kurse']['settings']['kurse_artikel'], $REX['CUR_CLANG']); // Die Elternkategorie if ($this->eltern_terminkategorie !== FALSE) { $pathname = seo42_appendToPath($pathname, $this->eltern_terminkategorie->name, $REX['ADDON']['d2u_kurse']['settings']['kurse_artikel'], $REX['CUR_CLANG']); } // Die Terminkategorie $pathname = seo42_appendToPath($pathname, $this->name, $REX['ADDON']['d2u_kurse']['settings']['kurse_artikel'], $REX['CUR_CLANG']); $pathname = substr($pathname, 0, -1) . $REX['ADDON']['seo42']['settings']['url_ending']; } else { // Ohne SEO42 $parameterArray = array(); $parameterArray['terminkategorie_id'] = $this->terminkategorie_id; $pathname = rex_getUrl($REX['ADDON']['d2u_kurse']['settings']['kurse_artikel'], $REX['CUR_CLANG'], $parameterArray, "&"); } $this->url = $pathname; } if ($path_only) { return $this->url; } else { return $REX['SERVER'] . $this->url; } }
function getCategory() { return OOCategory::getCategoryById($this->getCategoryId(), $this->getClang()); }
function getTemplates($category_id, $ignore_inactive = true) { global $REX; $ignore_inactive = $ignore_inactive ? 1 : 0; $templates = array(); $t_sql = rex_sql::factory(); $t_sql->setQuery('select id,name,attributes from ' . $REX['TABLE_PREFIX'] . 'template where active=' . $ignore_inactive . ' order by name'); if ($category_id < 1) { // Alle globalen Templates foreach ($t_sql->getArray() as $t) { $categories = rex_getAttributes("categories", $t["attributes"]); if (!is_array($categories) || $categories["all"] == 1) { $templates[$t["id"]] = $t['name']; } } } else { if ($c = OOCategory::getCategoryById($category_id)) { $path = $c->getPathAsArray(); $path[] = $category_id; foreach ($t_sql->getArray() as $t) { $categories = rex_getAttributes("categories", $t["attributes"]); // template ist nicht kategoriespezifisch -> includen if (!is_array($categories) || $categories["all"] == 1) { $templates[$t["id"]] = $t['name']; } else { // template ist auf kategorien beschraenkt.. // nachschauen ob eine davon im pfad der aktuellen kategorie liegt foreach ($path as $p) { if (in_array($p, $categories)) { $templates[$t["id"]] = $t['name']; break; } } } } } } return $templates; }
// Zuweisungen für Wiederanzeige $REX['MOD_REWRITE'] = $neu_modrewrite === 'TRUE'; // FŸr die Wiederanzeige Slashes strippen $REX['ERROR_EMAIL'] = stripslashes($neu_error_emailaddress); $REX['SERVER'] = stripslashes($neu_SERVER); $REX['SERVERNAME'] = stripslashes($neu_SERVERNAME); } } } $sel_template = new rex_select(); $sel_template->setStyle('class="rex-form-select"'); $sel_template->setName('neu_defaulttemplateid'); $sel_template->setId('rex-form-default-template-id'); $sel_template->setSize(1); $sel_template->setSelected($REX['DEFAULT_TEMPLATE_ID']); $templates = OOCategory::getTemplates(0); if (empty($templates)) { $sel_template->addOption($I18N->msg('option_no_template'), 0); } else { $sel_template->addArrayOptions($templates); } $sel_lang = new rex_select(); $sel_lang->setStyle('class="rex-form-select"'); $sel_lang->setName('neu_lang'); $sel_lang->setId('rex-form-lang'); $sel_lang->setSize(1); $sel_lang->setSelected($REX['LANG']); foreach ($REX['LOCALES'] as $l) { $sel_lang->addOption($l, $l); } $sel_mod_rewrite = new rex_select();
/** * Bearbeitet einen Artikel * * @param int $article_id Id des Artikels der verändert werden soll * @param int $clang Id der Sprache * @param array $data Array mit den Daten des Artikels * * @return array Ein Array welches den status sowie eine Fehlermeldung beinhaltet */ function rex_editArticle($article_id, $clang, $data) { global $REX, $I18N; $success = false; $message = ''; if (!is_array($data)) { trigger_error('Expecting $data to be an array!', E_USER_ERROR); } $templates = OOCategory::getTemplates($data['category_id']); // Wenn Template nicht vorhanden, dann entweder erlaubtes nehmen // oder leer setzen. if (!isset($templates[$data['template_id']])) { $data['template_id'] = 0; if (count($templates) > 0) { $data['template_id'] = key($templates); } } // Artikel mit alten Daten selektieren $thisArt = rex_sql::factory(); $thisArt->setQuery('select * from ' . $REX['TABLE_PREFIX'] . 'article where id=' . $article_id . ' and clang=' . $clang); if (isset($data['prior'])) { if ($data['prior'] <= 0) { $data['prior'] = 1; } } $EA = rex_sql::factory(); $EA->setTable($REX['TABLE_PREFIX'] . 'article'); $EA->setWhere("id='{$article_id}' and clang={$clang}"); $EA->setValue('name', $data['name']); $EA->setValue('template_id', $data['template_id']); $EA->setValue('prior', $data['prior']); $EA->addGlobalUpdateFields(); if ($EA->update()) { $message = $I18N->msg('article_updated'); // ----- PRIOR rex_newArtPrio($data['category_id'], $clang, $data['prior'], $thisArt->getValue('prior')); rex_deleteCacheArticle($article_id, $clang); // ----- EXTENSION POINT $message = rex_register_extension_point('ART_UPDATED', $message, array('id' => $article_id, 'article' => clone $EA, 'article_old' => clone $thisArt, 'status' => $thisArt->getValue('status'), 'name' => $data['name'], 'clang' => $clang, 're_id' => $data['category_id'], 'prior' => $data['prior'], 'path' => $data['path'], 'template_id' => $data['template_id'], 'data' => $data)); $success = true; } else { $message = $EA->getError(); } return array($success, $message); }
function _getNavigation($category_id, $depth = 1) { if ($category_id < 1) { $nav_obj = OOCategory::getRootCategories(); } else { $nav_obj = OOCategory::getChildrenById($category_id); } $lis = array(); foreach ($nav_obj as $nav) { $li = array(); $a = array(); $li['class'] = array(); $a['class'] = array(); $a['href'] = array($nav->getUrl()); if ($this->_checkFilter($nav, $depth) && $this->_checkCallbacks($nav, $depth, $li, $a)) { $li['class'][] = 'rex-article-' . $nav->getId(); // classes abhaengig vom pfad if ($nav->getId() == $this->current_category_id) { $li['class'][] = 'rex-current'; $a['class'][] = 'rex-current'; } elseif (in_array($nav->getId(), $this->path)) { $li['class'][] = 'rex-active'; $a['class'][] = 'rex-active'; } else { $li['class'][] = 'rex-normal'; } if (isset($this->linkclasses[$depth - 1])) { $a['class'][] = $this->linkclasses[$depth - 1]; } if (isset($this->classes[$depth - 1])) { $li['class'][] = $this->classes[$depth - 1]; } $li_attr = array(); foreach ($li as $attr => $v) { $li_attr[] = $attr . '="' . implode(' ', $v) . '"'; } $a_attr = array(); foreach ($a as $attr => $v) { $a_attr[] = $attr . '="' . implode(' ', $v) . '"'; } $l = '<li ' . implode(' ', $li_attr) . '>'; $l .= '<a ' . implode(' ', $a_attr) . '>' . htmlspecialchars($nav->getName()) . '</a>'; $depth++; if (($this->open || $nav->getId() == $this->current_category_id || in_array($nav->getId(), $this->path)) && ($this->max_depth >= $depth || $this->max_depth < 0)) { $l .= $this->_getNavigation($nav->getId(), $depth); } $depth--; $l .= '</li>'; $lis[] = $l; } } if (count($lis) > 0) { return '<ul class="rex-navi' . $depth . ' rex-navi-depth-' . $depth . ' rex-navi-has-' . count($lis) . '-elements">' . implode('', $lis) . '</ul>'; } return ''; }
function _getNavigation($category_id, $ignore_offlines = TRUE) { static $depth = 0; if ($category_id < 1) { $nav_obj = OOCategory::getRootCategories($ignore_offlines); } else { $nav_obj = OOCategory::getChildrenById($category_id, $ignore_offlines); } $nav_real = array(); foreach ($nav_obj as $nav) { // Filter und Rechte prüfen if ($this->_check($nav, $depth)) { $nav_real[] = $nav; } } $counter = 0; $count = count($nav_real); // $count = 4; $return = ""; if (count($nav_real) > 0) { $return .= '<ul class="navi-lev-' . ($depth + 1) . '">'; } foreach ($nav_real as $nav) { $counter++; $liClass = ''; $linkClass = ''; if ($counter == 1) { $liClass .= ' first'; } if ($counter == $count) { $liClass .= ' last'; } // classes abhaengig vom pfad if ($nav->getId() == $this->current_category_id) { $liClass .= ' current'; $linkClass .= ' current'; } elseif (in_array($nav->getId(), $this->path)) { $liClass .= ' active'; $linkClass .= ' active'; } else { $liClass .= ' normal'; } // classes abhaengig vom level if (isset($this->classes[$depth])) { $liClass .= ' ' . $this->classes[$depth]; } if (isset($this->linkclasses[$depth])) { $linkClass .= ' ' . $this->linkclasses[$depth]; } $name = str_replace(' ## ', '<br />', htmlspecialchars($nav->getName()), $str_count); if ($str_count >= 1) { $linkClass .= ' manbreak'; } $linkClass = $linkClass == '' ? '' : ' class="' . ltrim($linkClass) . '"'; if (isset($this->wrap_names[$depth]) && $this->wrap_names[$depth] != "") { $wrap = explode('|', $this->wrap_names[$depth]); $name = $wrap[0] . $name . $wrap[1]; } $link = '<a' . $linkClass . ' href="' . $nav->getUrl() . '">' . $name . '</a>'; if (isset($this->wrap_links[$depth]) && $this->wrap_links[$depth] != "") { $wrap = explode('|', $this->wrap_links[$depth]); $link = $wrap[0] . $link . $wrap[1]; } $return .= '<li class="navi-id-' . $nav->getId() . $liClass . '">' . $link; $depth++; if (($this->open || $nav->getId() == $this->current_category_id || in_array($nav->getId(), $this->path)) && ($this->depth > $depth || $this->depth < 0)) { $return .= $this->_getNavigation($nav->getId(), $ignore_offlines); } $depth--; $return .= '</li>'; } if (count($nav_real) > 0) { $return .= '</ul>'; } return $return; }
function getParent() { return $this->_re_category_id > 0 ? OOCategory::getCategoryById($this->_re_category_id) : null; }
function get() { $s = ''; $s_self = ''; $this->_depth = 0; if ($this->root_category === null) { $root_nodes = OOCategory::getRootCategories($this->ignore_offlines, $this->clang); } else { if (is_int($this->root_category) && $this->root_category === 0) { $root_nodes = OOArticle::getRootArticles($this->ignore_offlines, $this->clang); } else { $root_nodes = array(); $root_category = OOCategory::_getCategoryObject($this->root_category); // Rootkategorien selbst nicht anzeigen, nur deren Kind-Elemente if (is_array($root_category)) { foreach ($root_category as $root_cat) { $this->_appendChilds($root_cat, $root_nodes); $this->_appendArticles($root_cat, $root_nodes); } } else { $this->_appendChilds($root_category, $root_nodes); $this->_appendArticles($root_category, $root_nodes); } } } if (is_array($root_nodes)) { foreach ($root_nodes as $node) { $s_self .= $this->_formatNode($node); } // Parent Tag nur erstellen, wenn auch Childs vorhanden sind if ($s_self != '') { $s .= '<' . $this->main_tag . $this->main_attr . '>'; $s .= $s_self; $s .= '</' . $this->main_tag . '>'; } } return $s; }
else if (isDomIE) document.all[layerName].style.top=y else if (isDomNN) document.layers[layerName].top=y } var id2treeIndex = new Array() function initArray() { <?php ###################### FILL THE LINKMAP ARRAY ######################################### print "Note(0,-1,'','')\n"; foreach (OOCategory::getRootCategories(true) as $cat) { $parent = $cat->getId() * 9999; print "Note(" . $parent . ",0,'" . $cat->getName() . "','')\n"; foreach ($cat->getArticles(false) as $art) { print "Note(" . $art->getId() . "," . $parent . ",'" . $art->getName() . "','redaxo://" . $art->getId() . "')\n"; } foreach ($cat->getChildren(true) as $sub1) { $parent1 = $sub1->getId() * 9999; print "Note(" . $parent1 . "," . $parent . ",'" . $sub1->getName() . "','')\n"; foreach ($sub1->getArticles(false) as $art) { print "Note(" . $art->getId() . "," . $parent1 . ",'" . $art->getName() . "','redaxo://" . $art->getId() . "')\n"; } foreach ($sub1->getChildren(true) as $sub2) { $parent2 = $sub2->getId() * 9999; print "Note(" . $parent2 . "," . $parent1 . ",'" . $sub2->getName() . "','')\n"; foreach ($sub2->getArticles(false) as $art) {
} } echo "<tr>\n\t\t\t\t\t\t<td class=grey width=150>" . $I18N->msg("copy_article") . "</td>\n\t\t\t\t\t\t<td class=grey>" . $move_a->out() . "</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class=grey> </td>\n\t\t\t\t\t\t<td class=grey><input type=submit value='" . $I18N->msg("content_submitcopyarticle") . "' size=8></td>\n\t\t\t\t\t</tr>"; print '</form>'; } // --------------------------------------------------- ARTIKEL KOPIEREN ENDE // --------------------------------------------------- KATEGORIE/STARTARTIKEL VERSCHIEBEN START if ($article->getValue("startpage") == 1 && ($REX_USER->isValueOf("rights", "admin[]") || $REX_USER->isValueOf("rights", "moveCategory[]"))) { print "<form action=index.php method=get>\n\t\t\t\t\t\t<input type=hidden name=page value=content>\n\t\t\t\t\t\t<input type=hidden name=article_id value='{$article_id}'>\n\t\t\t\t\t\t<input type=hidden name=mode value='meta'>\n\t\t\t\t\t\t<input type=hidden name=clang value={$clang}>\n\t\t\t\t\t\t<input type=hidden name=ctype value={$ctype}>\n\t\t\t\t\t\t<input type=hidden name=function value=movecategory>"; $move_a = new select(); $move_a->set_name("category_id_new"); $move_a->set_style("width:100%;"); $move_a->set_size(1); $move_a->set_selected($article_id); $move_a->add_option("---", 0); if ($cats = OOCategory::getRootCategories()) { foreach ($cats as $cat) { add_cat_options($move_a, $cat, $cat_ids, "", " "); } } echo "<tr>\n\t\t\t\t\t\t<td class=grey width=150>" . $I18N->msg("move_category") . "</td>\n\t\t\t\t\t\t<td class=grey>" . $move_a->out() . "</td>\n\t\t\t\t\t </tr>\n\t\t\t\t\t <tr>\n\t\t\t\t\t <td class=grey> </td>\n\t\t\t\t\t\t<td class=grey><input type=submit value='" . $I18N->msg("content_submitmovecategory") . "' size=8></td>\n\t\t\t\t\t</tr>"; print '</form>'; } // ------------------------------------------------ KATEGROIE/STARTARTIKEL VERSCHIEBEN ENDE echo "</table>"; } // ------------------------------------------------------------- SONSTIGES ENDE // ------------------------------------------ END: META VIEW } echo " </td>\n \t<td class=lgrey> </td>\n </tr>\n </table>"; // ------------------------------------------ END: AUSGABE
/** * Erweitert das Meta-Formular um die neuen Meta-Felder * * @param string $prefix Feldprefix * @param string $params EP Params * @param callback $saveCallback Callback, dass die Daten speichert */ function _rex_a62_metainfo_form($prefix, $params, $saveCallback) { // Beim ADD gibts noch kein activeItem $activeItem = null; if (isset($params['activeItem'])) { $activeItem = $params['activeItem']; } $restrictionsCondition = ''; if ($prefix == 'art_') { if ($params['id'] != '') { $s = ''; $OOArt = OOArticle::getArticleById($params['id'], $params['clang']); // Alle Metafelder des Pfades sind erlaubt foreach (explode('|', $OOArt->getPath()) as $pathElement) { if ($pathElement != '') { $s .= ' OR `p`.`restrictions` LIKE "%|' . $pathElement . '|%"'; } } $restrictionsCondition = 'AND (`p`.`restrictions` = ""' . $s . ')'; } } elseif ($prefix == 'cat_') { $s = ''; if ($params['id'] != '') { $OOCat = OOCategory::getCategoryById($params['id'], $params['clang']); // Alle Metafelder des Pfades sind erlaubt foreach (explode('|', $OOCat->getPath()) as $pathElement) { if ($pathElement != '') { $s .= ' OR `p`.`restrictions` LIKE "%|' . $pathElement . '|%"'; } } // Auch die Kategorie selbst kann Metafelder haben $s .= ' OR `p`.`restrictions` LIKE "%|' . $params['id'] . '|%"'; } $restrictionsCondition = 'AND (`p`.`restrictions` = ""' . $s . ')'; } elseif ($prefix == 'med_') { $catId = rex_session('media[rex_file_category]', 'int'); if ($activeItem) { $catId = $activeItem->getValue('category_id'); } if ($catId !== '') { $s = ''; if ($catId != 0) { $OOCat = OOMediaCategory::getCategoryById($catId); // Alle Metafelder des Pfades sind erlaubt foreach (explode('|', $OOCat->getPath()) as $pathElement) { if ($pathElement != '') { $s .= ' OR `p`.`restrictions` LIKE "%|' . $pathElement . '|%"'; } } } // Auch die Kategorie selbst kann Metafelder haben $s .= ' OR `p`.`restrictions` LIKE "%|' . $catId . '|%"'; $restrictionsCondition = 'AND (`p`.`restrictions` = ""' . $s . ')'; } } $sqlFields = _rex_a62_metainfo_sqlfields($prefix, $restrictionsCondition); $params = rex_call_func($saveCallback, array($params, $sqlFields), false); return rex_a62_metaFields($sqlFields, $activeItem, 'rex_a62_metainfo_form_item', $params); }
</form> </div>'; } echo ' <!-- *** OUTPUT CATEGORIES - END *** --> '; // --------------------------------------------- ARTIKEL LISTE echo ' <!-- *** OUTPUT ARTICLES - START *** -->'; // --------------------- READ TEMPLATES if ($category_id > 0 || $category_id == 0 && !$REX['USER']->hasMountpoints()) { $template_select = new rex_select(); $template_select->setName('template_id'); $template_select->setId('rex-form-template'); $template_select->setSize(1); $templates = OOCategory::getTemplates($category_id); if (count($templates) > 0) { foreach ($templates as $t_id => $t_name) { $template_select->addOption(rex_translate($t_name, null, false), $t_id); $TEMPLATE_NAME[$t_id] = rex_translate($t_name); } } else { $template_select->addOption($I18N->msg('option_no_template'), '0'); $TEMPLATE_NAME[0] = $I18N->msg('template_default_name'); } // --------------------- ARTIKEL LIST $art_add_link = ''; if ($KATPERM && !$REX['USER']->hasPerm('editContentOnly[]')) { $art_add_link = '<a class="rex-i-element rex-i-article-add" href="index.php?page=structure&category_id=' . $category_id . '&function=add_art&clang=' . $clang . '"' . rex_accesskey($I18N->msg('article_add'), $REX['ACKEY']['ADD_2']) . '><span class="rex-i-element-text">' . $I18N->msg('article_add') . '</span></a>'; } $add_head = '';
else if (isDomIE) document.all[layerName].style.top=y else if (isDomNN) document.layers[layerName].top=y } var id2treeIndex = new Array() function initArray() { <?php ###################### FILL THE LINKMAP ARRAY ######################################### print "Note(0,-1,'','')\n"; foreach (OOCategory::getRootCategories(false) as $cat) { $parent = $cat->getId() * 9999; $color = $cat->_status != 1 ? "red" : "green"; print "Note(" . $parent . ",0,'<font color=" . $color . ">" . ereg_replace("\n|\r|\"|'", "", $cat->getName()) . "</font>','')\n"; foreach ($cat->getArticles(false) as $art) { $color = $art->_status != 1 ? "red" : "green"; print "Note(" . $art->getId() . "," . $parent . ",'<font color=" . $color . ">" . ereg_replace("\n|\r|\"|'", "", $art->getName()) . "</font>','redaxo://" . $art->getId() . "')\n"; } foreach ($cat->getChildren(false) as $sub1) { $parent1 = $sub1->getId() * 9999; $color = $sub1->_status != 1 ? "red" : "green"; print "Note(" . $parent1 . "," . $parent . ",'<font color=" . $color . ">" . ereg_replace("\n|\r|\"|'", "", $sub1->getName()) . "</font>','')\n"; foreach ($sub1->getArticles(false) as $art) { $color = $art->_status != 1 ? "red" : "green"; print "Note(" . $art->getId() . "," . $parent1 . ",'<font color=" . $color . ">" . ereg_replace("\n|\r|\"|'", "", $art->getName()) . "</font>','redaxo://" . $art->getId() . "')\n"; }
function rex_category_select($ignore_offlines = false, $clang = false, $check_perms = true, $add_homepage = true) { $this->ignore_offlines = $ignore_offlines; $this->clang = $clang; $this->check_perms = $check_perms; if ($add_homepage) { $this->addOption('Homepage', 0); } if ($cats = OOCategory::getRootCategories($ignore_offlines, $clang)) { foreach ($cats as $cat) { $this->addCatOption($cat); } } parent::rex_select(); }
/** * rex_rewriter_generate_pathnames * generiert die Pathlist, abhŠngig von Aktion * @author markus.staab[at]redaxo[dot]de Markus Staab * @package redaxo4.2 */ function rex_rewriter_generate_pathnames($params) { global $REX, $REXPATH; if (file_exists(FULLNAMES_PATHLIST)) { require_once FULLNAMES_PATHLIST; } if (!isset($REXPATH)) { $REXPATH = array(); } if (!isset($params['extension_point'])) { $params['extension_point'] = ''; } $where = ''; switch ($params['extension_point']) { // ------- sprachabhängig, einen artikel aktualisieren case 'CAT_DELETED': case 'ART_DELETED': unset($REXPATH[$params['id']]); break; case 'CAT_ADDED': case 'CAT_UPDATED': case 'ART_ADDED': case 'ART_UPDATED': $where = '(id=' . $params['id'] . ' AND clang=' . $params['clang'] . ') OR (path LIKE "%|' . $params['id'] . '|%" AND clang=' . $params['clang'] . ')'; break; // ------- alles aktualisieren // ------- alles aktualisieren case 'ALL_GENERATED': default: $where = '1=1'; break; } if ($where != '') { $db = new rex_sql(); // $db->debugsql=true; $db->setQuery('SELECT id,clang,path,startpage FROM ' . $REX['TABLE_PREFIX'] . 'article WHERE ' . $where . ' and revision=0'); while ($db->hasNext()) { $clang = $db->getValue('clang'); $pathname = ''; if (count($REX['CLANG']) > 1) { $pathname = $REX['CLANG'][$clang] . '/'; } // pfad über kategorien bauen $path = trim($db->getValue('path'), '|'); if ($path != '') { $path = explode('|', $path); foreach ($path as $p) { $ooc = OOCategory::getCategoryById($p, $clang); $name = $ooc->getName(); unset($ooc); // speicher freigeben $pathname = rex_rewriter_appendToPath($pathname, $name); } } $ooa = OOArticle::getArticleById($db->getValue('id'), $clang); if ($ooa->isStartArticle()) { $ooc = $ooa->getCategory(); $catname = $ooc->getName(); unset($ooc); // speicher freigeben $pathname = rex_rewriter_appendToPath($pathname, $catname); } // eigentlicher artikel anhängen $name = $ooa->getName(); unset($ooa); // speicher freigeben $pathname = rex_rewriter_appendToPath($pathname, $name); $pathname = substr($pathname, 0, strlen($pathname) - 1) . '.html'; $REXPATH[$db->getValue('id')][$db->getValue('clang')] = $pathname; $db->next(); } } rex_put_file_contents(FULLNAMES_PATHLIST, "<?php\n\$REXPATH = " . var_export($REXPATH, true) . ";\n"); }
} } ?> </ul> </div> <div id="rex-lmp"> <div class="rex-lmp-cats"> <h1><?php echo $I18N->msg('lmap_categories'); ?> </h1> <?php $roots = OOCategory::getRootCategories(); echo rex_linkmap_tree($tree, $category_id, $roots, $GlobalParams); ?> </div> <div class="rex-lmp-arts"> <h1><?php echo $I18N->msg('lmap_articles'); ?> </h1> <ul> <?php $articles = null; if ($isRoot) { $articles = OOArticle::getRootArticles(); } else { if ($category) {
protected function _getNavigation($categoryId) { global $REX; static $depth = 0; if ($categoryId < 1) { $cats = OOCategory::getRootCategories($this->ignoreOfflines); } else { $cats = OOCategory::getChildrenById($categoryId, $this->ignoreOfflines); } $return = ''; $ulIdAttribute = ''; $ulClassAttribute = ''; if (count($cats) > 0) { if (isset($this->ulId[$depth])) { $ulIdAttribute = ' id="' . $this->ulId[$depth] . '"'; } if (isset($this->ulClass[$depth])) { $ulClassAttribute = ' class="' . $this->ulClass[$depth] . '"'; } $return .= '<ul' . $ulIdAttribute . $ulClassAttribute . '>'; } foreach ($cats as $cat) { if ($this->_checkCallbacks($cat, $depth)) { $cssClasses = ''; $idAttribute = ''; // default li class if ($this->liClass != '') { $cssClasses .= ' ' . $this->liClass; } // li class if (is_array($this->liClassFromCategoryId) && isset($this->liClassFromCategoryId[$cat->getId()])) { $cssClasses .= ' ' . $this->liClassFromCategoryId[$cat->getId()]; } if ($this->liClassFromMetaField != '' && $cat->getValue($this->liClassFromMetaField) != '') { $cssClasses .= ' ' . $cat->getValue($this->liClassFromMetaField); } // li id if (is_array($this->liIdFromCategoryId) && isset($this->liIdFromCategoryId[$cat->getId()])) { $idAttribute = ' id="' . $this->liIdFromCategoryId[$cat->getId()] . '"'; } elseif ($this->liIdFromMetaField != '' && $cat->getValue($this->liIdFromMetaField) != '') { $idAttribute = ' id="' . $cat->getValue($this->liIdFromMetaField) . '"'; } // selected class if ($cat->getId() == $this->current_category_id) { // active menuitem $cssClasses .= ' ' . $this->activeClass; } elseif (in_array($cat->getId(), $this->path)) { // current menuitem $cssClasses .= ' ' . $this->selectedClass; } else { // do nothing } $trimmedCssClasses = trim($cssClasses); // build class attribute if ($trimmedCssClasses != '') { $classAttribute = ' class="' . $trimmedCssClasses . '"'; } else { $classAttribute = ''; } if ($this->hideWebsiteStartArticle && $cat->getId() == $REX['START_ARTICLE_ID'] || in_array($cat->getId(), $this->hideIds)) { // do nothing } else { $depth++; $urlType = 0; // default $return .= '<li' . $idAttribute . $classAttribute . '>'; if ($this->linkFromUserFunc != '') { $defaultLink = call_user_func($this->linkFromUserFunc, $cat, $depth); } else { $defaultLink = '<a href="' . $cat->getUrl() . '">' . htmlspecialchars($cat->getName()) . '</a>'; } if (!class_exists('seo42')) { // normal behaviour $return .= $defaultLink; } else { // only with seo42 2.0.0+ $urlData = seo42::getCustomUrlData($cat); // check if default lang has url clone option (but only if current categoy has no url data set) if (count($REX['CLANG']) > 1 && !isset($urlData['url_type'])) { $defaultLangCat = OOCategory::getCategoryById($cat->getId(), $REX['START_CLANG_ID']); $urlDataDefaultLang = seo42::getCustomUrlData($defaultLangCat); if (isset($urlDataDefaultLang['url_clone']) && $urlDataDefaultLang['url_clone']) { // clone url data from default language to current language $urlData = $urlDataDefaultLang; } } if (isset($urlData['url_type'])) { switch ($urlData['url_type']) { case 5: // SEO42_URL_TYPE_NONE $return .= htmlspecialchars($cat->getName()); break; case 4: // SEO42_URL_TYPE_LANGSWITCH $newClangId = $urlData['clang_id']; $newArticleId = $REX['ARTICLE_ID']; $catNewLang = OOCategory::getCategoryById($newArticleId, $newClangId); // if category that should be switched is not online, switch to start article of website if (OOCategory::isValid($catNewLang) && !$catNewLang->isOnline()) { $newArticleId = $REX['START_ARTICLE_ID']; } // select li that is current language if ($REX['CUR_CLANG'] == $newClangId) { $return = substr($return, 0, strlen($return) - strlen('<li>')); $return .= '<li class="' . $this->selectedClass . '">'; } $return .= '<a href="' . rex_getUrl($newArticleId, $newClangId) . '">' . htmlspecialchars($cat->getName()) . '</a>'; break; case 8: // SEO42_URL_TYPE_CALL_FUNC $return .= call_user_func($urlData['func'], $cat); break; default: $return .= $defaultLink; break; } } else { $return .= $defaultLink; } } if (($this->showAll || $cat->getId() == $this->current_category_id || in_array($cat->getId(), $this->path)) && ($this->levelDepth > $depth || $this->levelDepth < 0)) { $return .= $this->_getNavigation($cat->getId()); } $depth--; $return .= '</li>'; } } } if (count($cats) > 0) { $return .= '</ul>'; } return $return; }
<col width="40" /> <col width="315" /> <col width="153" /> </colgroup> <thead> <tr> <th class="rex-icon">' . $add_category . '</th> ' . $add_header . ' <th>' . $I18N->msg('header_category') . '</th> <th>' . $I18N->msg('header_priority') . '</th> <th>' . $I18N->msg('header_edit_category') . '</th> <th>' . $I18N->msg('header_status') . '</th> </tr> </thead> <tbody>'; if ($category_id != 0 && ($category = OOCategory::getCategoryById($category_id))) { echo '<tr> <td></td> <td colspan="' . $data_colspan . '"><a href="index.php?page=structure&category_id=' . $category->getParentId() . '&clang=' . $clang . '">..</a></td> </tr>'; } // --------------------- KATEGORIE ADD FORM if ($function == 'add_cat' && $KATPERM && !$REX_USER->hasPerm('editContentOnly[]')) { $add_td = ''; if ($REX_USER->hasPerm('advancedMode[]')) { $add_td = '<td class="rex-icon">-</td>'; } $add_buttons = rex_register_extension_point('CAT_FORM_BUTTONS', ""); $add_buttons .= '<input type="submit" class="rex-fsubmit" name="catadd_function" value="' . $I18N->msg('add_category') . '"' . rex_accesskey($I18N->msg('add_category'), $REX['ACKEY']['SAVE']) . ' />'; echo ' <tr class="rex-trow-actv">
function getCategory() { return OOCategory::getCategoryById($this->_category_id); }
<div class="breadcrumbs"><?php print $breadcrumbs; ?> </div> </div> </div> <div class="row" data-match-height> REX_ARTICLE[] </div> </div> </section> <footer> <div class="container"> <div class="row" data-match-height> <?php foreach (OOCategory::getRootCategories(true) as $lev1) { print '<div class="col-xs-12 col-sm-6 col-md-4 col-lg-3">'; print '<div class="footer-box" data-height-watch><a href="' . $lev1->getUrl() . '">' . $lev1->getName() . '</a></div>'; print '</div>'; } ?> </div> </div> </footer> <script type="text/javascript" src="<?php echo seo42::getMediaFile("bootstrap.min.js"); ?> "></script> <script> $(window).on("load", function(e) {
function _getNavigation($category_id, $ignore_offlines = TRUE) { static $depth = 0; if ($category_id < 1) { $nav_obj = OOCategory::getRootCategories($ignore_offlines); } else { $nav_obj = OOCategory::getChildrenById($category_id, $ignore_offlines); } $return = ""; if (count($nav_obj) > 0) { $return .= '<ul class="rex-navi' . ($depth + 1) . '">'; } foreach ($nav_obj as $nav) { $liClass = ''; $linkClass = ''; // classes abhaengig vom pfad if ($nav->getId() == $this->current_category_id) { $liClass .= ' rex-current'; $linkClass .= ' rex-current'; } elseif (in_array($nav->getId(), $this->path)) { $liClass .= ' rex-active'; $linkClass .= ' rex-active'; } else { $liClass .= ' rex-normal'; } // classes abhaengig vom level if (isset($this->classes[$depth])) { $liClass .= ' ' . $this->classes[$depth]; } if (isset($this->linkclasses[$depth])) { $linkClass .= ' ' . $this->linkclasses[$depth]; } $linkClass = $linkClass == '' ? '' : ' class="' . ltrim($linkClass) . '"'; $return .= '<li class="rex-article-' . $nav->getId() . $liClass . '">'; $return .= '<a' . $linkClass . ' href="' . $nav->getUrl() . '">' . htmlspecialchars($nav->getName()) . '</a>'; $depth++; if (($this->open || $nav->getId() == $this->current_category_id || in_array($nav->getId(), $this->path)) && ($this->depth > $depth || $this->depth < 0)) { $return .= $this->_getNavigation($nav->getId(), $ignore_offlines); } $depth--; $return .= '</li>'; } if (count($nav_obj) > 0) { $return .= '</ul>'; } return $return; }
$parent1 = $sub1->getId(); print "Note(" . $parent1 . "," . $parent . ",'" . ereg_replace("\n|\r|\"|'", "", $sub1->getName()) . "','')\n"; // hat artikel ?!? $myart = $sub1->getArticles(false); if (sizeof($myart) > 0) { foreach ($myart as $art) { print "Note(" . (100000 + $art->getId()) . "," . $parent1 . ",'" . ereg_replace("\n|\r|\"|'", "", $art->getName()) . "','redaxo://" . $art->getId() . "')\n"; } } // ist knoten und hat unterartikel ? rex_linkFolder($sub1->getChildren(), $parent1, $faktor + 1); } } } } rex_linkFolder(OOCategory::getRootCategories(false), 0, 100); ?> treeTyp[0] = 'f' treeIsOn[0] = true treeWasOn[0] = true } function preOpen() { var self_url=location.href var rexep = /[&?]id=(\d+(,\d+)*)/ if (rexep.test(self_url)) { rexep.exec(self_url) var a_id=RegExp.$1.split(',')