예제 #1
0
					      	<div class="rex-form-row">
									  <p class="rex-form-col-a rex-form-submit">
											<input class="rex-form-submit" type="submit" name="copyarticle" value="' . $I18N->msg('content_submitcopyarticle') . '"' . rex_tabindex() . ' onclick="return confirm(\'' . $I18N->msg('content_submitcopyarticle') . '?\')" />
									  </p>
								  </div>
								  
								  <div class="rex-clearer"></div>
								</div>
              </fieldset>';
            }
            // --------------------------------------------------- ARTIKEL KOPIEREN ENDE
            // --------------------------------------------------- KATEGORIE/STARTARTIKEL VERSCHIEBEN START
            if ($isStartpage && ($REX['USER']->isAdmin() || $REX['USER']->hasPerm('moveCategory[]') && $REX['USER']->hasCategoryPerm($article->getValue('re_id')))) {
                $move_a = new rex_category_select(false, false, true, !$REX['USER']->hasMountPoints());
                $move_a->setStyle('class="rex-form-select"');
                $move_a->setId('category_id_new');
                $move_a->setName('category_id_new');
                $move_a->setSize('1');
                $move_a->setSelected($article_id);
                $move_a->setAttribute('tabindex', rex_tabindex(false));
                $out .= '
              <fieldset class="rex-form-col-1">
                <legend>' . $I18N->msg('content_submitmovecategory') . '</legend>

					      <div class="rex-form-wrapper">
					      
					      	<div class="rex-form-row">
								  	<p class="rex-form-col-a rex-form-select">
											<label for="category_id_new">' . $I18N->msg('move_category') . '</label>
											' . $move_a->get() . '
									  </p>
예제 #2
0
 $modul_select = new rex_select();
 $modul_select->setMultiple(true);
 $modul_select->setStyle('class="rex-form-select"');
 $modul_select->setSize(10);
 $m_sql = rex_sql::factory();
 $m_sql->setQuery('SELECT id, name FROM ' . $REX['TABLE_PREFIX'] . 'module ORDER BY name');
 foreach ($m_sql->getArray() as $m) {
     $modul_select->addOption(rex_translate($m['name'], $I18N, false), $m['id']);
 }
 // Kategorien
 $cat_select = new rex_category_select(false, false, false, false);
 $cat_select->setMultiple(true);
 $cat_select->setStyle('class="rex-form-select"');
 $cat_select->setSize(10);
 $cat_select->setName('categories[]');
 $cat_select->setId('categories');
 if (count($categories) > 0) {
     foreach ($categories as $c => $cc) {
         // typsicherer vergleich, weil (0 != "all") => false
         if ($c !== 'all') {
             $cat_select->setSelected($cc);
         }
     }
 }
 $ctypes_out = '';
 $i = 1;
 $ctypes[] = '';
 // Extra, fŸr Neue Spalte
 if (is_array($ctypes)) {
     foreach ($ctypes as $id => $name) {
         $modul_select->setName('modules[' . $i . '][]');
/**
 * Backend Search Addon
 *
 * @author markus[dot]staab[at]redaxo[dot]de Markus Staab
 *
 * @package redaxo4
 * @version $Id: extension_search_structure.inc.php,v 1.2 2008/04/12 10:22:30 kills Exp $
 */
function rex_a256_search_structure($params)
{
    global $REX, $REX_USER, $I18N_BE_SEARCH;
    if (!($REX_USER->isAdmin() || $REX_USER->hasPerm('be_search[structure]'))) {
        return $params['subject'];
    }
    $message = '';
    $search_result = '';
    $editUrl = 'index.php?page=content&article_id=%s&mode=edit&clang=%s&a256_article_name=%s';
    $structureUrl = 'index.php?page=structure&category_id=%s&clang=%s&a256_article_name=%s';
    // ------------ globale Parameter
    $page = rex_request('page', 'string');
    $mode = rex_request('mode', 'string');
    $category_id = rex_request('category_id', 'int');
    $article_id = rex_request('article_id', 'int');
    $clang = rex_request('clang', 'int');
    $ctype = rex_request('ctype', 'int');
    // ------------ Parameter
    $a256_article_id = rex_request('a256_article_id', 'int');
    $a256_clang = rex_request('a256_clang', 'int');
    $a256_article_name = rex_request('a256_article_name', 'string');
    $a256_article_name_post = rex_post('a256_article_name', 'string');
    $mode = rex_request('mode', 'string');
    // ------------ Suche via ArtikelId
    if ($a256_article_id != 0) {
        $OOArt = OOArticle::getArticleById($a256_article_id, $a256_clang);
        if (OOArticle::isValid($OOArt)) {
            header('Location:' . sprintf($editUrl, $a256_article_id, $a256_clang, urlencode($a256_article_name)));
            exit;
        }
    }
    // Auswahl eines normalen Artikels => category holen
    if ($article_id != 0) {
        $OOArt = OOArticle::getArticleById($article_id, $clang);
        $category_id = $OOArt->getCategoryId();
    }
    // ------------ Suche via ArtikelName
    // hier nur dne post artikel namen abfragen,
    // da sonst bei vorherigen headerweiterleitungen
    // auch gesucht wuerde
    if ($a256_article_name_post != '') {
        $qry = '
    SELECT id
    FROM ' . $REX['TABLE_PREFIX'] . 'article
    WHERE
      clang = ' . $a256_clang . ' AND
      (
        name LIKE "%' . $a256_article_name . '%" OR
        catname LIKE "%' . $a256_article_name . '%"
      )';
        if ($category_id != 0) {
            $qry .= ' AND path LIKE "%|' . $category_id . '|%"';
        }
        $search = new rex_sql();
        //    $search->debugsql = true;
        $search->setQuery($qry);
        $foundRows = $search->getRows();
        // Suche ergab nur einen Treffer => Direkt auf den Treffer weiterleiten
        if ($foundRows == 1) {
            $OOArt = OOArticle::getArticleById($search->getValue('id'), $a256_clang);
            if ($REX_USER->hasCategoryPerm($OOArt->getCategoryId())) {
                header('Location:' . sprintf($editUrl, $search->getValue('id'), $a256_clang, urlencode($a256_article_name)));
                exit;
            }
        } else {
            if ($foundRows > 0) {
                $search_result .= '<ul class="a256-search-result">';
                for ($i = 0; $i < $foundRows; $i++) {
                    $OOArt = OOArticle::getArticleById($search->getValue('id'), $a256_clang);
                    $label = $OOArt->getName();
                    if ($REX_USER->hasCategoryPerm($OOArt->getCategoryId())) {
                        if ($REX_USER->hasPerm('advancedMode[]')) {
                            $label .= ' [' . $search->getValue('id') . ']';
                        }
                        $s = '';
                        $first = true;
                        foreach ($OOArt->getParentTree() as $treeItem) {
                            $treeLabel = $treeItem->getName();
                            if ($REX_USER->hasPerm('advancedMode[]')) {
                                $treeLabel .= ' [' . $treeItem->getId() . ']';
                            }
                            $prefix = ': ';
                            if ($first) {
                                $prefix = '';
                                $first = false;
                            }
                            $s .= '<li>' . $prefix . '<a href="' . sprintf($structureUrl, $treeItem->getId(), $a256_clang, urlencode($a256_article_name)) . '">' . htmlspecialchars($treeLabel) . ' </a></li>';
                        }
                        $prefix = ': ';
                        if ($first) {
                            $prefix = '';
                            $first = false;
                        }
                        $s .= '<li>' . $prefix . '<a href="' . sprintf($editUrl, $search->getValue('id'), $a256_clang, urlencode($a256_article_name)) . '">' . htmlspecialchars($label) . ' </a></li>';
                        $search_result .= '<li><ul class="a256-search-hit">' . $s . '</ul></li>';
                    }
                    $search->next();
                }
                $search_result .= '</ul>';
            } else {
                $message = rex_warning($I18N_BE_SEARCH->msg('search_no_results'));
            }
        }
    }
    $select_name = 'category_id';
    $add_homepage = true;
    if ($mode == 'edit' || $mode == 'meta') {
        $select_name = 'article_id';
        $add_homepage = false;
    }
    $category_select = new rex_category_select(false, false, true, $add_homepage);
    $category_select->setName($select_name);
    $category_select->setId('rex-a256-category-id');
    $category_select->setSize('1');
    $category_select->setAttribute('onchange', 'this.form.submit();');
    $category_select->setSelected($category_id);
    $form = '  <form action="index.php" method="post">
        <input type="hidden" name="page" id="rex-a256-article-clang" value="' . $page . '" />
        <input type="hidden" name="mode" id="rex-a256-article-clang" value="' . $mode . '" />
        <input type="hidden" name="category_id" id="rex-a256-article-clang" value="' . $category_id . '" />
        <input type="hidden" name="article_id" id="rex-a256-article-clang" value="' . $article_id . '" />
        <input type="hidden" name="clang" id="rex-a256-article-clang" value="' . $clang . '" />
        <input type="hidden" name="ctype" id="rex-a256-article-clang" value="' . $ctype . '" />
        <input type="hidden" name="a256_clang" id="rex-a256-article-clang" value="' . $clang . '" />

		    <div class="rex-f-lft">
	        <label for="rex-a256-article-name">' . $I18N_BE_SEARCH->msg('search_article_name') . '</label>
    	    <input type="text" name="a256_article_name" id="rex-a256-article-name" value="' . htmlspecialchars(stripslashes($a256_article_name)) . '"' . rex_tabindex() . ' />

        	<label for="rex-a256-article-id">' . $I18N_BE_SEARCH->msg('search_article_id') . '</label>
	        <input type="text" name="a256_article_id" id="rex-a256-article-id"' . rex_tabindex() . ' />
    	    <input class="rex-sbmt" type="submit" name="a256_start_search" value="' . $I18N_BE_SEARCH->msg('search_start') . '"' . rex_tabindex() . ' />
		    </div>

    		<div class="rex-f-rght">
    			<label for="rex-a256-category-id">' . $I18N_BE_SEARCH->msg('search_quick_navi') . '</label>';
    $category_select->setAttribute('tabindex', rex_tabindex(false));
    $form .= $category_select->get() . '
    			<noscript>
    			  <input type="submit" name="a256_start_jump" value="' . $I18N_BE_SEARCH->msg('search_jump_to_category') . '" />
    			</noscript>
        </div>
      </form>';
    $search_bar = $message . '<div id="rex-a256-searchbar">
     ' . $form . '
     ' . $search_result . '
   </div>
   <div class="rex-clearer"></div>';
    return $search_bar . $params['subject'];
}
예제 #4
0
파일: templates.php 프로젝트: DECAF/redaxo
 // modules[ctype_id]['all'];
 // Module ...
 $modul_select = new rex_select();
 $modul_select->setMultiple(true);
 $modul_select->setSize(10);
 $modul_select->setAttribute('class', 'form-control');
 $m_sql = rex_sql::factory();
 foreach ($m_sql->getArray('SELECT id, name FROM ' . rex::getTablePrefix() . 'module ORDER BY name') as $m) {
     $modul_select->addOption(rex_i18n::translate($m['name']), $m['id']);
 }
 // Kategorien
 $cat_select = new rex_category_select(false, false, false, false);
 $cat_select->setMultiple(true);
 $cat_select->setSize(10);
 $cat_select->setName('categories[]');
 $cat_select->setId('rex-id-categories-select');
 $cat_select->setAttribute('class', 'form-control');
 if (count($categories) > 0) {
     foreach ($categories as $c => $cc) {
         // typsicherer vergleich, weil (0 != "all") => false
         if ($c !== 'all') {
             $cat_select->setSelected($cc);
         }
     }
 }
 $ctypes_out = '';
 $i = 1;
 $ctypes[] = '';
 // Extra, fuer Neue Spalte
 if (is_array($ctypes)) {
     foreach ($ctypes as $id => $name) {
예제 #5
0
$sel_ext->setMultiple(1);
$sel_ext->setStyle('class="rex-form-select"');
$sel_ext->setSize(10);
$sel_ext->setName('userperm_ext[]');
$sel_ext->setId('userperm-ext');
sort($REX['EXTPERM']);
$sel_ext->addArrayOptions($REX['EXTPERM'], false);
$userperm_ext = rex_request('userperm_ext', 'array');
$allcats = rex_request('allcats', 'int');
// zugriff auf categorien
$sel_cat = new rex_category_select(false, false, false, false);
$sel_cat->setMultiple(1);
$sel_cat->setStyle('class="rex-form-select"');
$sel_cat->setSize(20);
$sel_cat->setName('userperm_cat[]');
$sel_cat->setId('userperm-cat');
$userperm_cat = rex_request('userperm_cat', 'array');
$allmcats = rex_request('allmcats', 'int');
$userperm_cat_read = rex_request('userperm_cat_read', 'array');
// zugriff auf mediacategorien
$sel_media = new rex_mediacategory_select(false);
$sel_media->setMultiple(1);
$sel_media->setStyle('class="rex-form-select"');
$sel_media->setSize(20);
$sel_media->setName('userperm_media[]');
$sel_media->setId('userperm-media');
$userperm_media = rex_request('userperm_media', 'array');
// zugriff auf sprachen
$sel_sprachen = new rex_select();
$sel_sprachen->setMultiple(1);
$sel_sprachen->setStyle('class="rex-form-select"');