/**
 * Ausgabe des Seitentitels
 *
 *
 * Beispiel für einen Seitentitel
 *
 * <code>
 * $subpages = array(
 *  array( ''      , 'Index'),
 *  array( 'lang'  , 'Sprachen'),
 *  array( 'groups', 'Gruppen')
 * );
 *
 * rex_title( 'Headline', $subpages)
 * </code>
 *
 *
 * Beispiel für einen Seitentitel mit Rechteprüfung
 *
 * <code>
 * $subpages = array(
 *  array( ''      , 'Index'   , 'index_perm'),
 *  array( 'lang'  , 'Sprachen', 'lang_perm'),
 *  array( 'groups', 'Gruppen' , 'group_perm')
 * );
 *
 * rex_title( 'Headline', $subpages)
 * </code>
 *
 *
 * Beispiel für einen Seitentitel eigenen Parametern
 *
 * <code>
 * $subpages = array(
 *  array( ''      , 'Index'   , '', array('a' => 'b')),
 *  array( 'lang'  , 'Sprachen', '', 'a=z&x=12'),
 *  array( 'groups', 'Gruppen' , '', array('clang' => $REX['CUR_CLANG']))
 * );
 *
 * rex_title( 'Headline', $subpages)
 * </code>
 */
function rex_title($head, $subtitle = '')
{
    global $article_id, $category_id, $page, $I18N;
    if (empty($subtitle)) {
        $subtitle = '<div class="rex-title-row rex-title-row-sub rex-title-row-empty"><p>&nbsp;</p></div>';
    } else {
        if (is_array($subtitle) && rex_be_page_container::isValid($subtitle[0])) {
            $nav = rex_be_navigation::factory();
            $nav->setHeadline('default', $I18N->msg('subnavigation', $head));
            foreach ($subtitle as $pageObj) {
                $nav->addPage($pageObj);
            }
            $nav->setActiveElements();
            $subtitle = '<div class="rex-title-row rex-title-row-sub rex-navi-page">' . $nav->getNavigation() . '</div>';
        } else {
            // REDAXO <= 4.2 compat
            $subtitle = '<div class="rex-title-row rex-title-row-sub">' . rex_get_subtitle($subtitle) . '</div>';
        }
    }
    // ----- EXTENSION POINT
    $head = rex_register_extension_point('PAGE_TITLE', $head, array('category_id' => $category_id, 'article_id' => $article_id, 'page' => $page));
    print '
	<div id="rex-title">
  		<div class="rex-title-row"><h1>' . $head . '</h1></div>
  		' . $subtitle . '
	</div>';
    rex_register_extension_point('PAGE_TITLE_SHOWN', $subtitle, array('category_id' => $category_id, 'article_id' => $article_id, 'page' => $page));
    print '
<!-- *** OUTPUT OF CONTENT - START *** -->
	<div id="rex-output">
	';
}
Example #2
0
 /**
  * Returns the formatted title.
  *
  * @param string            $head
  * @param null|string|array $subtitle
  *
  * @throws InvalidArgumentException
  *
  * @return string
  */
 public static function title($head, $subtitle = null)
 {
     if ($subtitle !== null && !is_string($subtitle) && (!is_array($subtitle) || count($subtitle) > 0 && !reset($subtitle) instanceof rex_be_page)) {
         throw new InvalidArgumentException('Expecting $subtitle to be a string or an array of rex_be_page!');
     }
     if ($subtitle === null) {
         $subtitle = rex_be_controller::getPageObject(rex_be_controller::getCurrentPagePart(1))->getSubpages();
     }
     if (is_array($subtitle) && count($subtitle) && reset($subtitle) instanceof rex_be_page) {
         $nav = rex_be_navigation::factory();
         $nav->setHeadline('default', rex_i18n::msg('subnavigation', $head));
         foreach ($subtitle as $pageObj) {
             $nav->addPage($pageObj);
         }
         $blocks = $nav->getNavigation();
         $navigation = [];
         if (count($blocks) == 1) {
             $navigation = current($blocks);
             $navigation = $navigation['navigation'];
         }
         if (!empty($navigation)) {
             $fragment = new rex_fragment();
             $fragment->setVar('left', $navigation, false);
             $subtitle = $fragment->parse('core/navigations/content.php');
         } else {
             $subtitle = '';
         }
     } elseif (!is_string($subtitle)) {
         $subtitle = '';
     }
     $title = rex_extension::registerPoint(new rex_extension_point('PAGE_TITLE', $head));
     $fragment = new rex_fragment();
     $fragment->setVar('heading', $title, false);
     $fragment->setVar('subtitle', $subtitle, false);
     $return = $fragment->parse('core/page/header.php');
     $return .= rex_extension::registerPoint(new rex_extension_point('PAGE_TITLE_SHOWN', ''));
     return $return;
 }
Example #3
0
        $REX['PAGE'] = 'login';
        $REX['USER'] = null;
        $REX['LOGIN'] = null;
    } else {
        // Userspezifische Sprache einstellen, falls gleicher Zeichensatz
        $lang = $REX['LOGIN']->getLanguage();
        $I18N_T = rex_create_lang($lang, '', FALSE);
        if ($I18N->msg('htmlcharset') == $I18N_T->msg('htmlcharset')) {
            $I18N = rex_create_lang($lang);
        }
        $REX['USER'] = $REX['LOGIN']->USER;
    }
}
// ----- Prepare Core Pages
if ($REX['USER']) {
    $REX['PAGES'] = rex_be_navigation::getLoggedInPages($REX['USER']);
}
// ----- INCLUDE ADDONS
include_once $REX['INCLUDE_PATH'] . '/addons.inc.php';
// ----- Prepare AddOn Pages
if ($REX['USER']) {
    foreach (OOAddon::getAvailableAddons() as $addonName) {
        $title = OOAddon::getProperty($addonName, 'name', '');
        $href = OOAddon::getProperty($addonName, 'link', 'index.php?page=' . $addonName);
        $perm = OOAddon::getProperty($addonName, 'perm', '');
        $addonPage = null;
        $mainAddonPage = null;
        if ($perm == '' || $REX['USER']->hasPerm($perm) || $REX['USER']->isAdmin()) {
            if ($title != '') {
                $addonPage = new rex_be_page($title, array('page' => $addonName));
                $addonPage->setHref($href);
Example #4
0
File: top.php Project: eaCe/redaxo
    $item = [];
    $item['title'] = '<i class="rex-icon rex-icon-sign-out"></i> ' . rex_i18n::msg('logout');
    $item['href'] = rex_url::backendController(['rex_logout' => 1]);
    $item['attributes'] = 'class="rex-logout"' . rex::getAccesskey(rex_i18n::msg('logout'), 'logout');
    $meta_items[] = $item;
    unset($item);
} elseif ($hasNavigation) {
    $item = [];
    $item['title'] = rex_i18n::msg('logged_out');
    $meta_items[] = $item;
    unset($item);
}
// wird in bottom.php an Fragment uebergeben
$navigation = '';
if (rex::getUser() && $hasNavigation) {
    $n = rex_be_navigation::factory();
    foreach (rex_be_controller::getPages() as $p => $pageObj) {
        $p = strtolower($p);
        if ($pageObj instanceof rex_be_page_main) {
            $pageObj->setItemAttr('id', 'rex-navi-page-' . strtolower(preg_replace('/[^a-zA-Z0-9\\-]*/', '', str_replace('_', '-', $p))));
            if (!$pageObj->getBlock()) {
                $pageObj->setBlock('addons');
            }
            if (!$pageObj->getHref()) {
                $pageObj->setHref(rex_url::backendPage($p, [], false));
            }
            /*
             if(isset ($REX['ACKEY']['ADDON'][$page]))
                $item['extra'] = rex_accesskey($name, $REX['ACKEY']['ADDON'][$page]);
            else
                $item['extra'] = rex_accesskey($pageArr['title'], $accesskey++);
Example #5
0
             rex_response::sendRedirect($context->getUrl(['page' => 'content/edit', 'info' => $info], false));
         } else {
             $warning = rex_i18n::msg('content_error_movecategory');
         }
     } else {
         $warning = rex_i18n::msg('no_rights_to_this_function');
     }
 }
 // ------------------------------------------ END: MOVE CATEGORY
 // ------------------------------------------ START: CONTENT HEAD MENUE
 $editPage = rex_be_controller::getPageObject('content/edit');
 foreach ($ctypes as $key => $val) {
     $editPage->addSubpage((new rex_be_page('ctype' . $key, rex_i18n::translate($val)))->setHref(['page' => 'content/edit', 'article_id' => $article_id, 'clang' => $clang, 'ctype' => $key], false)->setIsActive($ctype == $key));
 }
 $leftNav = rex_be_navigation::factory();
 $rightNav = rex_be_navigation::factory();
 foreach (rex_be_controller::getPageObject('content')->getSubpages() as $subpage) {
     if (!$subpage->hasHref()) {
         $subpage->setHref($context->getUrl(['page' => $subpage->getFullKey()], false));
     }
     if ($subpage->getItemAttr('left')) {
         $leftNav->addPage($subpage);
     } else {
         $rightNav->addPage($subpage);
     }
     $subpage->removeItemAttr('left');
 }
 $blocks = $leftNav->getNavigation();
 $navigation = current($blocks);
 $content_navi_left = $navigation['navigation'];
 $blocks = $rightNav->getNavigation();