コード例 #1
0
 function getBreadcrumb($startPageLabel, $includeCurrent = FALSE, $category_id = 0)
 {
     if (!$this->_setActivePath()) {
         return FALSE;
     }
     global $REX;
     $path = $this->path;
     $i = 1;
     $lis = '';
     if ($startPageLabel) {
         $lis .= '<li class="rex-lvl' . $i . '"><a href="' . rex_getUrl($REX['START_ARTICLE_ID']) . '">' . htmlspecialchars($startPageLabel) . '</a></li>';
         $i++;
         // StartArticle nicht doppelt anzeigen
         if (isset($path[0]) && $path[0] == $REX['START_ARTICLE_ID']) {
             unset($path[0]);
         }
     }
     foreach ($path as $pathItem) {
         if ($cat = OOCategory::getCategoryById($pathItem) && $this->_check($cat, $i)) {
             $lis .= '<li class="rex-lvl' . $i . '"><a href="' . $cat->getUrl() . '">' . htmlspecialchars($cat->getName()) . '</a></li>';
             $i++;
         }
     }
     if ($includeCurrent) {
         if ($art = OOArticle::getArticleById($this->current_article_id) && $this->_check($art, $i)) {
             if (!$art->isStartpage()) {
                 $lis .= '<li class="rex-lvl' . $i . '">' . htmlspecialchars($art->getName()) . '</li>';
             } else {
                 $cat = OOCategory::getCategoryById($this->current_article_id);
                 $lis .= '<li class="rex-lvl' . $i . '">' . htmlspecialchars($cat->getName()) . '</li>';
             }
         }
     }
     return '<ul class="rex-breadcrumb">' . $lis . '</ul>';
 }
コード例 #2
0
 function rex_com_messages_add_buttons($params)
 {
     global $REX;
     if ($REX['COM_USER']->getValue("rex_com_user.id") != $params["user_id"]) {
         $params["buttons"][] = '<a href="' . rex_getUrl(REX_COM_PAGE_SENDMESSAGE_ID, 0, array("user_id" => $params["user_id"], "tab" => 2)) . '"><span>Private Nachricht senden</span></a>';
     }
 }
コード例 #3
0
 function executeAction()
 {
     // spezialfaelle - nur bei request oder label
     switch ($this->getElement(3)) {
         case 'request':
             if (!isset($_REQUEST[$this->getElement(4)])) {
                 return false;
             }
             break;
         case 'label':
             if (!isset($this->params['value_pool']['sql'][$this->getElement(4)])) {
                 return false;
             }
             break;
     }
     $u = $this->getElement(2);
     $u1 = (string) (int) $u;
     if ($u == $u1) {
         // id -> intern article
         $url = rex_getUrl($u, '', '', '&');
     } else {
         // extern link
         $url = $u;
     }
     // Emailkeys ersetzen. Somit auch Weiterleitungen mit neuer ID m�glich. "id=###ID###"
     foreach ($this->params['value_pool']['email'] as $search => $replace) {
         $url = str_replace('###' . $search . '###', $replace, $url);
     }
     if ($url != '') {
         ob_end_clean();
         header('Location: ' . $url);
     }
 }
コード例 #4
0
ファイル: forward.php プロジェクト: tzfrs/redaxo_yrewrite
 public static function getForward($params)
 {
     // Url wurde von einer anderen Extension bereits gesetzt
     if (isset($params['subject']) && $params['subject'] != '') {
         return $params['subject'];
     }
     self::init();
     $domain = $params['domain'];
     if ($domain == 'undefined') {
         $domain = '';
     }
     $url = $params['url'];
     foreach (self::$paths as $p) {
         if ($p['domain'] == $domain && ($p['url'] == $url || $p['url'] . '/' == $url)) {
             $forward_url = '';
             if ($p['type'] == 'article' && ($art = rex_article::get($p['article_id'], $p['clang']))) {
                 $forward_url = rex_getUrl($p['article_id'], $p['clang']);
             } elseif ($p['type'] == 'media' && ($media = rex_media::get($p['media']))) {
                 $forward_url = '/files/' . $p['media'];
             } elseif ($p['type'] == 'extern' && $p['extern'] != '') {
                 $forward_url = $p['extern'];
             }
             if ($forward_url != '') {
                 header('HTTP/1.1 ' . self::$movetypes[$p['movetype']]);
                 header('Location: ' . $forward_url);
                 exit;
             }
         }
     }
     return false;
 }
コード例 #5
0
 /**
  * GET SITEMAP ARTICLES FROM DB
  *
  * @return (array) sitemap articles
  */
 private function get_db_articles()
 {
     global $REX, $SEO42_URLS;
     if ($REX['ADDON']['seo42']['settings']['rewriter']) {
         // use seo42 pathlist
         array_multisort($SEO42_URLS);
         foreach ($SEO42_URLS as $url) {
             $article = OOArticle::getArticleById($url['id'], $url['clang']);
             if (OOArticle::isValid($article)) {
                 $hasPermission = true;
                 // community addon
                 if (class_exists('rex_com_auth') && !rex_com_auth::checkPerm($article)) {
                     $hasPermission = false;
                 }
                 // add sitemap block
                 if (($article->isOnline() || $article->getId() == $REX['START_ARTICLE_ID'] && $article->getClang() == $REX['START_CLANG_ID']) && !isset($url['status']) && $hasPermission) {
                     $db_articles[$url['id']][$url['clang']] = array('loc' => rex_getUrl($url['id'], $url['clang']), 'lastmod' => date('c', $article->getValue('updatedate')), 'changefreq' => self::calc_article_changefreq($article->getValue('updatedate'), ''), 'priority' => self::calc_article_priority($url['id'], $url['clang'], $article->getValue('path'), ''), 'noindex' => $article->getValue('seo_noindex'));
                 }
             }
         }
     } else {
         // at the moment: no sitemap urls if rewriter is turned off
     }
     // EXTENSIONPOINT SEO42_SITEMAP_ARRAY_CREATED
     $db_articles = rex_register_extension_point('SEO42_SITEMAP_ARRAY_CREATED', $db_articles);
     // EXTENSIONPOINT SEO42_SITEMAP_ARRAY_FINAL (READ ONLY)
     rex_register_extension_point('SEO42_SITEMAP_ARRAY_FINAL', $db_articles);
     $this->db_articles = $db_articles;
 }
コード例 #6
0
    function enterObject(&$email_elements, &$sql_elements, &$warning, &$form_output, $send = 0)
    {
        // var_dump($this->params);
        global $REX;
        require_once realpath(dirname(__FILE__) . '/../../ext/captcha/class.captcha_x.php');
        if (isset($_REQUEST["captcha"]) && $_REQUEST["captcha"] == "show") {
            ob_end_clean();
            ob_end_clean();
            $server =& new captcha_x();
            $server->handle_request();
            exit;
        }
        $captcha =& new captcha_x();
        $wc = "";
        if ($send == 1 & $captcha->validate($this->value)) {
            // Alles ist gut.
        } elseif ($send == 1) {
            // Error. Fehlermeldung ausgeben
            $this->params["warning"][] = $this->elements[2];
            $this->params["warning_messages"][] = $this->elements[2];
            $wc = $this->params["error_class"];
        }
        $link = rex_getUrl($this->params["article_id"], $this->params["clang"], array("captcha" => "show"), "&");
        $form_output[] = '
			<p class="formcaptcha">
				<span class="' . $wc . '">' . htmlspecialchars($this->elements[1]) . '</span>
				<label class="captcha ' . $wc . '"><img 
					src="' . $link . '" 
					onclick="javascript:this.src=\'' . $link . '&\'+Math.random();" 
					alt="CAPTCHA image" 
					/></label>
				<input class="' . $wc . '" maxlength="5" size="5" name="FORM[' . $this->params["form_name"] . '][el_' . $this->id . ']" type="text" />
			</p>';
    }
コード例 #7
0
 function enterObject()
 {
     global $REX;
     require_once realpath(dirname(__FILE__) . '/../../ext/captcha/class.captcha_x.php');
     $captcha = new captcha_x();
     $captchaRequest = rex_request('captcha', 'string');
     if ($captchaRequest == 'show') {
         while (@ob_end_clean()) {
         }
         $captcha->handle_request();
         exit;
     }
     if ($this->params['send'] == 1 & $captcha->validate($this->getValue())) {
         if (isset($_SESSION['captcha'])) {
             unset($_SESSION['captcha']);
         }
     } elseif ($this->params['send'] == 1) {
         // Error. Fehlermeldung ausgeben
         $this->params['warning'][$this->getId()] = $this->params['error_class'];
         $this->params['warning_messages'][$this->getId()] = $this->getElement(2);
     }
     if ($this->getElement(3) != '') {
         $link = $this->getElement(3) . '?captcha=show&' . time() . microtime();
     } else {
         $link = rex_getUrl($this->params['article_id'], $this->params['clang'], array('captcha' => 'show'), '&') . '&' . time() . microtime();
     }
     $this->params['form_output'][$this->getId()] = $this->parse('value.captcha.tpl.php', array('link' => $link));
 }
コード例 #8
0
ファイル: var_link.php プロジェクト: DECAF/redaxo
 protected function getOutput()
 {
     $id = $this->getArg('id', 0, true);
     if (!in_array($this->getContext(), ['module', 'action']) || !is_numeric($id) || $id < 1 || $id > 10) {
         return false;
     }
     $value = $this->getContextData()->getValue('link' . $id);
     if ($this->hasArg('isset') && $this->getArg('isset')) {
         return $value ? 'true' : 'false';
     }
     if ($this->hasArg('widget') && $this->getArg('widget')) {
         if (!$this->environmentIs(self::ENV_INPUT)) {
             return false;
         }
         $args = [];
         foreach (['category'] as $key) {
             if ($this->hasArg($key)) {
                 $args[$key] = $this->getArg($key);
             }
         }
         $value = self::getWidget($id, 'REX_INPUT_LINK[' . $id . ']', $value, $args);
     } else {
         if ($value && $this->hasArg('output') && $this->getArg('output') != 'id') {
             $value = rex_getUrl($value);
         }
     }
     return self::quote($value);
 }
コード例 #9
0
 function execute()
 {
     // spezialfaelle - nur bei request oder label
     switch ($this->getElement(3)) {
         case "request":
             if (!isset($_REQUEST[$this->getElement(4)])) {
                 return FALSE;
             }
             break;
         case "label":
             if (!isset($this->elements_sql[$this->getElement(4)])) {
                 return FALSE;
             }
             break;
     }
     $u = $this->getElement(2);
     $u1 = (int) $u;
     if ($u == $u1) {
         // id -> intern article
         $url = rex_getUrl($u, '', '', "&");
     } else {
         // extern link
         $url = $u;
     }
     // Emailkeys ersetzen. Somit auch Weiterleitungen mit neuer ID mšglich. "id=###ID###"
     foreach ($this->elements_email as $search => $replace) {
         $url = str_replace('###' . $search . '###', $replace, $url);
     }
     if ($url != '') {
         ob_end_clean();
         header("Location: " . $url);
         exit;
     }
 }
コード例 #10
0
ファイル: function_rex_url.php プロジェクト: alsahh/redaxo
/**
 * Leitet auf einen anderen Artikel weiter.
 *
 * @package redaxo\structure
 */
function rex_redirect($article_id, $clang = null, array $params = [])
{
    // Alle OBs schließen
    while (@ob_end_clean()) {
    }
    header('Location: ' . rex_getUrl($article_id, $clang, $params, '&'));
    exit;
}
コード例 #11
0
 public function getRSS()
 {
     $anzahl = $this->anzahl;
     $queryurl = rex_getUrl('', $REX['CUR_CLANG'], array('page' => ''), "&");
     // URL fuers Blaettern
     $string = file_get_contents($this->url);
     if (empty($string)) {
         $string = self::file_get_contents_curl($this->url);
     }
     $xml = new SimpleXMLElement($string);
     // define the namespaces that we are interested in
     $ns = array('content' => 'http://purl.org/rss/1.0/modules/content/', 'wfw' => 'http://wellformedweb.org/CommentAPI/', 'dc' => 'http://purl.org/dc/elements/1.1/');
     isset($_GET['page']) ? $page = (int) $_GET['page'] : ($page = 1);
     $startwert_seite = $anzahl * ($page - 1) + 1;
     $endwert_seite = $page * $anzahl;
     if ($endwert_seite > sizeof($xml->channel->item)) {
         $endwert_seite = sizeof($xml->channel->item);
     }
     $anzahl_seiten = ceil(sizeof($xml->channel->item) / $anzahl);
     $itemh1 = $xml->channel->title;
     $itemDesc = $xml->channel->description;
     if (sizeof($xml->channel->item) / $anzahl > 1 and $this->blaettern == 1) {
         $pager['start'] = $startwert_seite;
         $pager['end'] = $endwert_seite;
         $pager['gesamt'] = sizeof($xml->channel->item);
         $pager['jumplist'] = self::drawJumplist($queryurl . "[PAGE]", "&laquo;", "", "&raquo;", $page, $anzahl_seiten);
     }
     if (!class_exists('Smarty')) {
         include 'redaxo/include/addons/news/libs/Smarty.class.php';
     }
     $t = new Smarty();
     //$t->force_compile = true;
     $t->debugging = false;
     $t->caching = false;
     $t->cache_lifetime = 120;
     $t->config_dir = 'redaxo/include/addons/news/view/configs/';
     $t->compile_dir = 'redaxo/include/addons/news/view/templates_c/';
     $t->cache_dir = 'redaxo/include/addons/news/view/cache/';
     $t->template_dir = 'redaxo/include/addons/news/view/templates/';
     $k = 0;
     foreach ($xml->channel->item as $article) {
         if ($k + 1 >= $startwert_seite and $k + 1 <= $endwert_seite) {
             $item[$k]['url'] = $article->link;
             $item[$k]['enclosure'] = $article->enclosure['url'];
             $item[$k]['title'] = $article->title;
             $item[$k]['pubDate'] = date("d.m.Y", self::rsstotime($article->pubDate));
             $item[$k]['description'] = $article->description;
         }
         $k++;
     }
     $t->assign("data", $item);
     $t->assign("pager", $pager);
     $t->assign("itemDesc", $itemDesc);
     $t->assign("itemh1", $itemh1);
     $t->display('rss.tpl');
     return;
 }
コード例 #12
0
 function setRedaxoVars($aid, $clang = "", $params = array())
 {
     global $REX;
     if ($clang == "") {
         $clang = $REX["CUR_CLANG"];
     }
     $this->setObjectparams("article_id", $aid);
     $this->setObjectparams("clang", $clang);
     $this->setObjectparams("form_action", rex_getUrl($aid, $clang, $params));
 }
コード例 #13
0
 function execute()
 {
     $element_2 = $this->action["elements"][2];
     $url = '';
     if (preg_match('/^[0-9]+$/i', $element_2)) {
         $url = rex_getUrl($element_2, '', '', "&");
     } elseif ($element_2 != '') {
         $url = $element_2;
     }
     // Emailkeys ersetzen. Somit auch Weiterleitungen mit neuer ID mšglich. "id=###ID###"
     foreach ($this->elements_email as $search => $replace) {
         $url = str_replace('###' . $search . '###', $replace, $url);
     }
     if ($url != '') {
         ob_end_clean();
         header("Location: " . $url);
         exit;
     }
 }
コード例 #14
0
 function a724_generatePathnamesFromTable($params)
 {
     $debug = false;
     $sql = new rex_sql();
     $results = $sql->getArray('SELECT article_id, url_table, url_table_parameters FROM rex_a724_frau_schultze WHERE url_table != "" AND url_table_parameters != ""');
     $URLPATH = array();
     if ($sql->getRows() >= 1) {
         a724_deletePathnamesFromTable();
         foreach ($results as $result) {
             if (is_array($result) && count($result) > 0) {
                 $path = rex_getUrl($result['article_id']) . '/';
                 $path = str_replace('.html', '', $path);
                 $table = $result['url_table'];
                 $params = unserialize($result['url_table_parameters']);
                 $col_name = $params[$table][$table . "_name"];
                 $col_id = $params[$table][$table . "_id"];
                 // Daten zum Aufbau der Urls holen
                 $sqlu = new rex_sql();
                 $sqlu->setDebug($debug);
                 $res = $sqlu->getArray('SELECT ' . $col_name . ' AS name, ' . $col_id . ' AS id FROM ' . $table);
                 if ($sqlu->getRows() >= 1) {
                     // Urls in die Datenbank schreiben
                     $sqli = new rex_sql();
                     $sqli->setDebug($debug);
                     foreach ($res as $re) {
                         $table_path = $path . strtolower(rex_parse_article_name($re['name'])) . '.html';
                         $table_id = $re['id'];
                         $URLPATH[$result['url_table']][$table_id] = $table_path;
                         $sqli->setTable('rex_a724_frau_schultze');
                         $sqli->setValue('article_id', $result['article_id']);
                         $sqli->setValue('status', '1');
                         $sqli->setValue('url_table', $result['url_table']);
                         $sqli->setValue('name', $table_path);
                         $sqli->insert();
                     }
                 }
             }
         }
     }
     rex_put_file_contents(A724_URL_TABLE_PATHLIST, "<?php\n\$URLPATH = " . var_export($URLPATH, true) . ";\n");
 }
コード例 #15
0
 function url_generate_column_article($params)
 {
     global $I18N;
     $list = $params['list'];
     $return = '';
     $a = OOArticle::getArticleById($list->getValue("article_id"), $list->getValue("clang"));
     if ($a instanceof OOArticle) {
         $return = $a->getName();
         $return .= ' [';
         $return .= '<a href="index.php?article_id=' . $list->getValue('article_id') . '&amp;clang=' . $list->getValue('clang') . '">Backend</a>';
         $return .= ' | ';
         $return .= '<a href="' . rex_getUrl($list->getValue('article_id'), $list->getValue('clang')) . '">Frontend</a>';
         $return .= ']';
         $tree = $a->getParentTree();
         $levels = array();
         foreach ($tree as $object) {
             $levels[] = $object->getName();
         }
         $return .= '<div class="url-control-path"><small><b>Pfad: </b>' . implode(' : ', $levels) . '</small></div>';
     }
     return $return;
 }
コード例 #16
0
    function enterObject(&$email_elements, &$sql_elements, &$warning, &$form_output, $send = 0)
    {
        global $REX;
        require_once realpath(dirname(__FILE__) . '/../../ext/captcha/class.captcha_x.php');
        $captcha = new captcha_x();
        $captchaRequest = rex_request('captcha', 'string');
        if ($captchaRequest == "show") {
            while (@ob_end_clean()) {
            }
            $captcha->handle_request();
            exit;
        }
        $wc = "";
        // hier bewusst nur ein "&" (konditionales und, kein boolsches und!)
        if ($send == 1 & $captcha->validate($this->value)) {
            // Alles ist gut.
            // *** Captcha Code leeren, nur einmal verwenden, doppelt versand des Formulars damit auch verhindern
            if (isset($_SESSION['captcha'])) {
                unset($_SESSION['captcha']);
            }
        } elseif ($send == 1) {
            // Error. Fehlermeldung ausgeben
            $this->params["warning"][$this->getId()] = $this->elements[2];
            $this->params["warning_messages"][$this->getId()] = $this->elements[2];
            $wc = $this->params["error_class"];
        }
        $link = rex_getUrl($this->params["article_id"], $this->params["clang"], array("captcha" => "show"), "&");
        if ($wc != '') {
            $wc = ' ' . $wc;
        }
        $form_output[] = '
			<p class="formcaptcha" id="' . $this->getHTMLId() . '">
				<label class="captcha' . $wc . '" for="el_' . $this->id . '">' . htmlspecialchars($this->elements[1]) . '</label>
				<span class="as-label' . $wc . '"><img  src="' . $link . '" onclick="javascript:this.src=\'' . $link . '&\'+Math.random();" alt="CAPTCHA image" /></span>
				<input class="captcha' . $wc . '" maxlength="5" size="5" id="el_' . $this->id . '" name="' . $this->getFormFieldname() . '" type="text" />
			</p>';
        // Ende
    }
コード例 #17
0
 function enterObject()
 {
     require_once realpath(dirname(__FILE__) . '/../../ext/captcha_calc/class.captcha_calc_x.php');
     $captcha = new captcha_calc_x();
     $captchaRequest = rex_request('captcha_calc', 'string');
     if ($captchaRequest == 'show') {
         while (@ob_end_clean()) {
         }
         $captcha->handle_request();
         exit;
     }
     if ($this->params['send'] == 1 && $captcha->validate($this->value)) {
     } elseif ($this->params['send'] == 1) {
         $this->params['warning'][$this->getId()] = $this->params['error_class'];
         $this->params['warning_messages'][$this->getId()] = $this->getElement(2);
     }
     if ($this->getElement(3) != '') {
         $link = $this->getELement(3) . '?captcha_calc=show&' . time();
     } else {
         $link = rex_getUrl($this->params['article_id'], $this->params['clang'], array('captcha_calc' => 'show'), '&');
     }
     $this->params['form_output'][$this->getId()] = $this->parse('value.captcha_calc.tpl.php', array('link' => $link));
 }
コード例 #18
0
/**
 * Leitet auf einen anderen Artikel weiter
 */
function rex_redirect($article_id, $clang = '', $params = array())
{
    global $REX;
    // Alle OBs schließen
    while (@ob_end_clean()) {
    }
    $divider = '&';
    $url = rex_getUrl($article_id, $clang, $params, $divider);
    header('Location: ' . $url);
    exit;
}
コード例 #19
0
function getUrlByid($id, $clang = "", $params = "")
{
    return rex_getUrl($id, $clang, $params);
}
コード例 #20
0
ファイル: class.nav42.inc.php プロジェクト: omphteliba/seo42
 protected function _getLangNavigation()
 {
     global $REX;
     // ul id
     if ($this->langUlId == '') {
         $ulIdAttribute = '';
     } else {
         $ulIdAttribute = ' id="' . $this->langUlId . '"';
     }
     $out = '<ul' . $ulIdAttribute . '>';
     foreach ($REX['CLANG'] as $clangId => $clangName) {
         $article = OOArticle::getArticleById($REX['ARTICLE_ID'], $clangId);
         // new article id
         if (OOArticle::isValid($article) && $article->isOnline()) {
             $newArticleId = $article->getId();
             $articleStatus = true;
         } else {
             $newArticleId = $REX['START_ARTICLE_ID'];
             $articleStatus = false;
         }
         if (!$articleStatus && $this->langHideLiIfOfflineArticle) {
             // do nothing
         } else {
             $langCode = '';
             $originalName = '';
             $langSlug = '';
             if (class_exists('seo42')) {
                 $langCode = seo42::getLangCode($clangId);
                 $originalName = seo42::getOriginalLangName($clangId);
                 $langSlug = seo42::getLangUrlSlug($clangId);
             }
             if ($langCode == '') {
                 $langCode = $clangName;
             }
             if ($originalName == '') {
                 $originalName = $clangName;
             }
             if ($langSlug == '') {
                 $langSlug = $clangName;
             }
             // link text
             if ($this->langUseLangCodeAsLinkText) {
                 $linkText = $langCode;
             } else {
                 $linkText = $originalName;
             }
             if ($this->langUpperCaseLinkText) {
                 $linkText = strtoupper($linkText);
             }
             // li attribute
             if ($this->langShowLiIds) {
                 $liIdAttribute = ' id="' . $langSlug . '"';
             } else {
                 $liIdAttribute = '';
             }
             // class attribute
             if ($REX['CUR_CLANG'] == $clangId) {
                 $liClassAttribute = ' class="' . $this->langSelectedClass . '"';
             } else {
                 $liClassAttribute = '';
             }
             // li out
             $out .= '<li' . $liIdAttribute . $liClassAttribute . '><a href="' . rex_getUrl($newArticleId, $clangId) . '">' . $linkText . '</a></li>';
         }
     }
     $out .= '</ul>';
     return $out;
 }
コード例 #21
0
 /**
  * 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;
     }
 }
コード例 #22
0
 function getLinkUrl($index)
 {
     return rex_getUrl($this->getLink($index));
 }
コード例 #23
0
ファイル: boot.php プロジェクト: redaxo/redaxo
                $select .= '<option value="' . $version['history_date'] . '">' . $version['history_date'] . '</option>';
            }
            $content1select = '<select id="content-history-select-date-1" class="content-history-select" data-iframe="content-history-iframe-1" style="">' . $select . '</select>';
            $content1iframe = '<iframe id="content-history-iframe-1" class="history-iframe"></iframe>';
            $content2select = '<select id="content-history-select-date-2" class="content-history-select" data-iframe="content-history-iframe-2">' . $select . '</select>';
            $content2iframe = '<iframe id="content-history-iframe-2" class="history-iframe"></iframe>';
            $button_restore = '<a class="btn btn-apply" href="javascript:rex_history_snapVersion(\'content-history-select-date-2\');">' . $this->i18n('snapshot_reactivate') . '</a>';
            // fragment holen und ausgeben
            $fragment = new rex_fragment();
            $fragment->setVar('title', $this->i18n('overview_versions'));
            $fragment->setVar('info', $info, false);
            $fragment->setVar('content1select', $content1select, false);
            $fragment->setVar('content1iframe', $content1iframe, false);
            $fragment->setVar('content2select', $content2select, false);
            $fragment->setVar('content2iframe', $content2iframe, false);
            $fragment->setVar('button_restore', $button_restore, false);
            echo $fragment->parse('history/layer.php');
            exit;
    }
    rex_extension::register('STRUCTURE_CONTENT_HEADER', function (rex_extension_point $ep) {
        if ($ep->getParam('page') == 'content/edit') {
            echo '<script>
                    var history_article_id = ' . rex_article::getCurrentId() . ';
                    var history_clang_id = ' . rex_clang::getCurrentId() . ';
                    var history_ctype_id = ' . rex_request('ctype', 'int', 0) . ';
                    var history_revision = ' . rex_request('rex_set_version', 'int', 0) . ';
                    var history_article_link = "' . rex_getUrl(rex_article::getCurrentId(), rex_clang::getCurrentId(), ['history_revision' => rex_request('rex_set_version', 'int', 0)], '&') . '";
                    </script>';
        }
    });
}
コード例 #24
0
 function getLink($extra_params = array())
 {
     $params = array_merge($this->addlink, $extra_params);
     return rex_getUrl($this->article_id, '', $params);
 }
コード例 #25
0
 static function _formatRexUrl($value, $format)
 {
     if (empty($value)) {
         return '';
     }
     if (!is_array($format)) {
         $format = array();
     }
     // format in dem die werte gespeichert sind
     if (empty($format['format'])) {
         // default: <article-id>-<clang-id>
         $format['format'] = '%i-%i';
     }
     $hits = sscanf($value, $format['format'], $value, $format['clang']);
     if ($hits == 1) {
         // clang
         if (empty($format['clang'])) {
             $format['clang'] = '';
         }
     }
     // Linkparameter (z.b. subject=Hallo Sir)
     if (empty($format['params'])) {
         $format['params'] = '';
     } else {
         if (!startsWith($format['params'], '?')) {
             $format['params'] = '?' . $format['params'];
         }
     }
     // divider
     if (empty($format['divider'])) {
         $format['divider'] = '&amp;';
     }
     return '<a href="' . rex_getUrl($value, $format['clang'], $format['params'], $format['divider']) . '"' . $format['attr'] . '>' . $value . '</a>';
 }
コード例 #26
0
ファイル: auth.php プロジェクト: BackupTheBerlios/redaxo-svn
} else {
    // echo "nichts";
    $rex_com_auth_info = 0;
    // 0 - nichts / 1 - logout / 2 - failed login / 3 - logged in
    unset($REX['COM_USER']);
}
$rex_com_auth_jump = rex_request('rex_com_auth_jump', 'string');
if (isset($jump_aid) && ($article = OOArticle::getArticleById($jump_aid)) || $rex_com_auth_use_jump_url && $rex_com_auth_jump != "") {
    ob_end_clean();
    $url_params['rex_com_auth_info'] = $rex_com_auth_info;
    if ($rex_com_auth_use_jump_url && $rex_com_auth_jump != "") {
        header('Location: http://' . $REX["SERVER"] . '/' . rex_com_auth_urldecode($rex_com_auth_jump));
    } else {
        if ($rex_com_auth_jump != "") {
            $url_params[$REX['ADDON']['community']['plugin_auth']['request']['jump']] = $rex_com_auth_jump;
        }
        header('Location:' . rex_getUrl($jump_aid, '', $url_params, '&'));
    }
    exit;
}
// ---------- page_permissions
if ($article = OOArticle::getArticleById($REX["ARTICLE_ID"])) {
    if (!rex_com_checkperm($article)) {
        ob_end_clean();
        header('Location:' . rex_getUrl($REX['ADDON']['community']['plugin_auth']['article_withoutperm'], '', $url_params, '&'));
        exit;
    }
} else {
    // Wenn Article nicht vorhanden - nichts machen -> wird dann von der index.php geregelt sodass eine fehlerseite auftaucht
    // $jump_aid = $REX['ADDON']['community']['plugin_auth']['article_withoutperm'];
}
コード例 #27
0
ファイル: modulAusgabe_1.php プロジェクト: Sysix/asd_news
    echo $title;
    ?>
</h3>
        <img src="<?php 
    echo $news->getImage();
    ?>
" alt="" class="news-picture">
        <span class="asd-news-date"><?php 
    echo $date->format('d. ') . $news->getMonthName() . $date->format(' Y H:i');
    ?>
</span>
        <?php 
    echo $text;
    ?>
        <a class="button" href="<?php 
    echo rex_getUrl('', '');
    ?>
">zurück</a>
    </div>
    <?php 
} else {
    $newsList = rex_asd_news::getNewsByCategory('REX_VALUE[1]');
    $pager = new rex_asd_pager($REX['ADDON']['asd_news']['config']['max-per-page'], 'page');
    $pager->setRowCount(count($newsList));
    $newsList = $pager->filterList($newsList);
    foreach ($newsList as $news) {
        /** @var rex_asd_news $news */
        $title = $news->getValue('title');
        $url = $news->getUrl();
        $id = $news->getValue('id');
        $date = $news->getPublishDate();
コード例 #28
0
    function getGuestbook($user_id, $aid, $params = array())
    {
        global $REX;
        $MY = FALSE;
        if (is_object($REX['COM_USER']) && $REX['COM_USER']->getValue("rex_com_user.id") == $user_id) {
            $MY = TRUE;
        }
        $u = new rex_sql();
        $u->setQuery("select * from rex_com_user where id=" . $user_id);
        if ($u->getRows() != 1) {
            return "";
        }
        // ***** ADD MESSAGE
        if (is_object($REX['COM_USER']) && $_REQUEST["add_message"] != "") {
            $text = $_REQUEST["text"];
            if ($text == "") {
                $errormessage = '<p class="warning" colspan=2>Es wurde keine Nachricht eingetragen !</p>';
            } else {
                $addmsgsql = new rex_sql();
                $addmsgsql->setTable("rex_com_guestbook");
                $addmsgsql->setValue("user_id", $user_id);
                $addmsgsql->setValue("from_user_id", $REX['COM_USER']->getValue("id"));
                $addmsgsql->setValue("text", $text);
                $addmsgsql->setValue("create_datetime", time());
                $addmsgsql->insert();
                if ($user_id != $REX['COM_USER']->getValue('rex_com_user.id')) {
                    rex_com_user::exeAction($user_id, "sendemail_guestbook", array("user_id" => $REX['COM_USER']->getValue('rex_com_user.id'), "firstname" => $REX['COM_USER']->getValue('rex_com_user.firstname'), "name" => $REX['COM_USER']->getValue('rex_com_user.name'), "login" => $REX['COM_USER']->getValue('rex_com_user.login'), "to_user_id" => $u->getValue('rex_com_user.id'), "to_firstname" => $u->getValue('rex_com_user.firstname'), "to_name" => $u->getValue('rex_com_user.name'), "to_login" => $u->getValue('rex_com_user.login')));
                }
            }
        } elseif ($MY && $_REQUEST["delete_message"] != "") {
            $msg_id = (int) $_REQUEST["msg_id"];
            if ($msg_id == 0) {
                $errormessage = '<p class="warning">Es wurde keine Nachricht ausgewählt!</p>';
            } else {
                $addmsgsql = new rex_sql();
                // $addmsgsql->debugsql = 1;
                $addmsgsql->setQuery('delete from rex_com_guestbook where id=' . $msg_id . ' and user_id="' . $REX['COM_USER']->getValue("id") . '"');
            }
        }
        // ***** SHOW MESSAGES
        $guestsql = new rex_sql();
        $guestsql->debugsql = 0;
        $guestsql->setQuery("SELECT * \n\t\t\tFROM  rex_com_guestbook \n\t\t\tLEFT JOIN rex_com_user ON rex_com_guestbook.from_user_id=rex_com_user.id \n\t\t\tWHERE rex_com_guestbook.user_id='" . $user_id . "' \n\t\t\tORDER BY rex_com_guestbook.create_datetime desc");
        if ($guestsql->getRows() <= 0) {
            $echo .= '<p class="com-whitebox">Kein Gästebucheintrag vorhanden !</p>';
        } else {
            $cl = "";
            for ($i = 0; $i < $guestsql->getRows(); $i++) {
                // $cl
                $echo .= '
				<div class="com-guestbook">
					<div class="com-image">
						<p class="image">' . rex_com_showUser($guestsql, "image") . '</p>
					</div>

					<div class="com-content">
					<div class="com-content-2">
					
						<div class="com-content-name">
							<p><span class="color-1">' . rex_com_showUser($guestsql, "name") . ', ' . rex_com_showUser($guestsql, "city", "", FALSE) . '</span>
								<br />' . rex_com_formatter($guestsql->getValue("rex_com_guestbook.create_datetime"), 'datetime') . '
							</p>
						</div>
						<p><b>' . nl2br(htmlspecialchars($guestsql->getValue("rex_com_guestbook.text"))) . '</b></p>';
                if ($guestsql->getValue("rex_com_user.motto") != '') {
                    $echo .= '<p>Motto: ' . $guestsql->getValue("rex_com_user.motto") . '</p>';
                }
                if ($MY) {
                    $link_params = array_merge($params, array("user_id" => $user_id, "delete_message" => 1, "msg_id" => $guestsql->getValue("rex_com_guestbook.id")));
                    $echo .= '<br /><p class="link-button"><a href="' . rex_getUrl($aid, '', $link_params) . '"><span>Löschen</span></a></p>';
                }
                $echo .= '</div></div>
					<div class="clearer"> </div>
				</div>';
                if ($cl == "") {
                    $cl = ' class="alternative"';
                } else {
                    $cl = "";
                }
                $guestsql->next();
            }
        }
        //		$echo .= '</tr></table>';
        if (is_object($REX['COM_USER'])) {
            $echo .= '<div id="rex-form" class="com-guestbook-form spcl-bgcolor">
			
			<form action="' . $REX["FRONTEND_FILE"] . '" method="post" id="guestbookform">
			
			<h2>Einen neuen Eintrag schreiben</h2>

			' . $errormessage . '
			
			<input type="hidden" name="add_message" value="1" />
			<input type="hidden" name="user_id" value="' . $user_id . '" />
			<input type="hidden" name="article_id" value="' . $aid . '" />
			';
            foreach ($params as $k => $v) {
                $echo .= '<input type="hidden" name="' . $k . '" value="' . htmlspecialchars($v) . '" />';
            }
            $echo .= '
				<p class="formtextarea">
					<label for="f-message">Nachricht:</label>
					<textarea id="f-message" name="text" cols="40" rows="4" /></textarea>
				</p>
				<p class="link-save">
					<a href="javascript:void(0);"  onclick="document.getElementById(\'guestbookform\').submit()"><span>Speichern</span></a></p>
				</p>
			<div class="clearer"> </div>
			
			</form>
			</div>';
        }
        return $echo;
    }
コード例 #29
0
             $class = ' class="rex-navi-first"';
         }
         $ctype_menu .= '<li' . $class . '>' . $listElement . '</li>';
     }
     $ctype_menu .= '</ul>';
 }
 $menu = $ctype_menu;
 $listElements = array();
 if ($mode == 'edit') {
     $listElements[] = '<a href="index.php?page=content&amp;article_id=' . $article_id . '&amp;mode=edit&amp;clang=' . $clang . '&amp;ctype=' . $ctype . '" class="rex-active"' . rex_tabindex() . '>' . $I18N->msg('edit_mode') . '</a>';
     $listElements[] = '<a href="index.php?page=content&amp;article_id=' . $article_id . '&amp;mode=meta&amp;clang=' . $clang . '&amp;ctype=' . $ctype . '"' . rex_tabindex() . '>' . $I18N->msg('metadata') . '</a>';
 } else {
     $listElements[] = '<a href="index.php?page=content&amp;article_id=' . $article_id . '&amp;mode=edit&amp;clang=' . $clang . '&amp;ctype=' . $ctype . '"' . rex_tabindex() . '>' . $I18N->msg('edit_mode') . '</a>';
     $listElements[] = '<a href="index.php?page=content&amp;article_id=' . $article_id . '&amp;mode=meta&amp;clang=' . $clang . '&amp;ctype=' . $ctype . '" class="rex-active"' . rex_tabindex() . '>' . $I18N->msg('metadata') . '</a>';
 }
 $listElements[] = '<a href="../' . rex_getUrl($article_id, $clang) . '" onclick="window.open(this.href); return false;" ' . rex_tabindex() . '>' . $I18N->msg('show') . '</a>';
 // ----- EXTENSION POINT
 $listElements = rex_register_extension_point('PAGE_CONTENT_MENU', $listElements, array('article_id' => $article_id, 'clang' => $clang, 'function' => $function, 'mode' => $mode, 'slice_id' => $slice_id));
 $menu .= "\n" . '<ul class="rex-navi-content">';
 $num_elements = count($listElements);
 $menu_first = true;
 for ($i = 0; $i < $num_elements; $i++) {
     $class = '';
     if ($menu_first) {
         $class = ' class="rex-navi-first"';
     }
     $menu .= '<li' . $class . '>' . $listElements[$i] . '</li>';
     $menu_first = false;
 }
 $menu .= '</ul>';
 // ------------------------------------------ END: CONTENT HEAD MENUE
コード例 #30
0
ファイル: navigation.php プロジェクト: skerbis/redaxo
 /**
  * Generiert eine Breadcrumb-Navigation.
  *
  * @param string $startPageLabel Label der Startseite, falls FALSE keine Start-Page anzeigen
  * @param bool   $includeCurrent True wenn der aktuelle Artikel enthalten sein soll, sonst FALSE
  * @param int    $category_id    Id der Wurzelkategorie
  *
  * @return string
  */
 public function getBreadcrumb($startPageLabel, $includeCurrent = false, $category_id = 0)
 {
     if (!$this->_setActivePath()) {
         return false;
     }
     $path = $this->path;
     $i = 1;
     $lis = '';
     if ($startPageLabel) {
         $lis .= '<li class="rex-lvl' . $i . '"><a href="' . rex_getUrl(rex::getProperty('start_article_id')) . '">' . htmlspecialchars($startPageLabel) . '</a></li>';
         ++$i;
         // StartArticle nicht doppelt anzeigen
         if (isset($path[0]) && $path[0] == rex::getProperty('start_article_id')) {
             unset($path[0]);
         }
     }
     foreach ($path as $pathItem) {
         $cat = rex_category::get($pathItem);
         $lis .= '<li class="rex-lvl' . $i . '"><a href="' . $cat->getUrl() . '">' . htmlspecialchars($cat->getName()) . '</a></li>';
         ++$i;
     }
     if ($includeCurrent) {
         if ($art = rex_article::get($this->current_article_id)) {
             if (!$art->isStartArticle()) {
                 $lis .= '<li class="rex-lvl' . $i . '">' . htmlspecialchars($art->getName()) . '</li>';
             }
         } else {
             $cat = rex_category::get($this->current_article_id);
             $lis .= '<li class="rex-lvl' . $i . '">' . htmlspecialchars($cat->getName()) . '</li>';
         }
     }
     return '<ul class="rex-breadcrumb">' . $lis . '</ul>';
 }