当前位置: 首页>>代码示例>>PHP>>正文


PHP rex_translate函数代码示例

本文整理汇总了PHP中rex_translate函数的典型用法代码示例。如果您正苦于以下问题:PHP rex_translate函数的具体用法?PHP rex_translate怎么用?PHP rex_translate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了rex_translate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: enterObject

    function enterObject(&$email_elements, &$sql_elements, &$warning, &$form_output, $send = 0)
    {
        if ($this->getValue() == "" && !$send) {
            if (isset($this->elements[3])) {
                $this->setValue($this->elements[3]);
            }
        }
        $classes = "";
        if (isset($this->elements[5])) {
            $classes .= " " . $this->elements[5];
        }
        $wc = "";
        if (isset($warning[$this->getId()])) {
            $wc = " " . $warning[$this->getId()];
        }
        $this->params["form_output"][$this->getId()] = '
			<p class="formtext formlabel-' . $this->getName() . '" id="' . $this->getHTMLId() . '">
				<label class="text' . $wc . '" for="' . $this->getFieldId() . '" >' . rex_translate($this->getElement(2)) . '</label>
				<input type="text" class="text' . $classes . $wc . '" name="' . $this->getFieldName() . '" id="' . $this->getFieldId() . '" value="' . htmlspecialchars(stripslashes($this->getValue())) . '" />
			</p>';
        $email_elements[$this->elements[1]] = stripslashes($this->getValue());
        if (!isset($this->elements[4]) || $this->elements[4] != "no_db") {
            $sql_elements[$this->elements[1]] = $this->getValue();
        }
    }
开发者ID:rotzek,项目名称:redaxo_xform,代码行数:25,代码来源:class.xform.text.inc.php

示例2: enterObject

    function enterObject(&$email_elements, &$sql_elements, &$warning, &$form_output, $send = 0)
    {
        if (!isset($this->elements[3]) || $this->elements[3] == "") {
            $this->elements[3] = 1;
        }
        $checked = "";
        if ($this->getElement(3) != "" && $this->getValue() == $this->getElement(3)) {
            $checked = ' checked="checked"';
            $v = $this->getElement(3);
        } elseif ($this->getValue() == 1) {
            $checked = ' checked="checked"';
            $v = 1;
        } else {
            $this->setValue("0");
            $v = 1;
        }
        $wc = "";
        if (isset($warning[$this->getId()])) {
            $wc = $warning[$this->getId()];
        }
        $form_output[$this->getId()] = '
			<p class="formcheckbox formlabel-' . $this->getName() . '" id="' . $this->getHTMLId() . '">
				<input type="checkbox" class="checkbox ' . $wc . '" name="' . $this->getFieldName() . '" id="' . $this->getFieldId() . '" value="' . $v . '" ' . $checked . ' />
				<label class="checkbox ' . $wc . '" for="' . $this->getFieldId() . '" >' . rex_translate($this->elements[2]) . '</label>
			</p>';
        $email_elements[$this->elements[1]] = stripslashes($this->value);
        if (!isset($this->elements[5]) || $this->elements[5] != "no_db") {
            $sql_elements[$this->elements[1]] = $this->value;
        }
    }
开发者ID:rotzek,项目名称:redaxo_xform,代码行数:30,代码来源:class.xform.checkbox.inc.php

示例3: enterObject

    function enterObject(&$email_elements, &$sql_elements, &$warning, &$form_output, $send = 0)
    {
        if ($this->value == "" && !$send) {
            if (isset($this->elements[3])) {
                $this->setValue($this->elements[3]);
            }
        }
        $classes = "";
        if (isset($this->elements[5])) {
            $classes .= " " . $this->elements[5];
        }
        $wc = "";
        if (isset($warning[$this->getId()])) {
            $wc = " " . $warning[$this->getId()];
        }
        $form_output[$this->getId()] = '
		<p class="formtextarea" id="' . $this->getHTMLId() . '">
			<label class="textarea ' . $wc . '" for="el_' . $this->id . '" >' . rex_translate($this->getElement(2)) . '</label>
			<textarea class="textarea' . $classes . $wc . '" name="' . $this->getFormFieldname() . '" id="el_' . $this->getId() . '" cols="80" rows="10">' . htmlspecialchars(stripslashes($this->value)) . '</textarea>
		</p>';
        $email_elements[$this->getName()] = stripslashes($this->value);
        if (!isset($this->elements[4]) || $this->elements[4] != "no_db") {
            $sql_elements[$this->getName()] = $this->getValue();
        }
    }
开发者ID:rotzek,项目名称:redaxo_xform,代码行数:25,代码来源:class.xform.textarea.inc.php

示例4: printLangSelect

    public static function printLangSelect($params)
    {
        global $REX, $I18N;
        $out = '';
        $clang = rex_request('clang', 'int');
        $out .= '
			 <div id="rex-clang" class="rex-toolbar">
			 <div class="rex-toolbar-content">
				 <ul>
					 <li>' . $I18N->msg("languages") . ' : </li>';
        $i = 0;
        $stop = false;
        foreach ($REX['CLANG'] as $key => $val) {
            $i++;
            if ($i == 1) {
                $out .= '<li class="rex-navi-first rex-navi-clang-' . $key . '">';
            } else {
                $out .= '<li class="rex-navi-clang-' . $key . '">';
            }
            $val = rex_translate($val);
            $class = '';
            if ($key == $clang) {
                $class = ' class="rex-active"';
            }
            $curQuery = rex_post('current_query', 'string', '');
            if ($curQuery != '') {
                $urlQuery = $curQuery;
                parse_str($curQuery, $vals);
                $vals['clang'] = $key;
                $urlQuery = http_build_query($vals);
            } else {
                $urlQuery = self::getURLQuery($key);
            }
            if (!$REX['USER']->isAdmin() && !$REX['USER']->hasPerm('clang[all]') && !$REX['USER']->hasPerm('clang[' . $key . ']')) {
                $out .= '<span class="rex-strike">' . $val . '</span>';
                if ($clang == $key) {
                    $stop = true;
                }
            } else {
                $out .= '<a' . $class . ' href="index.php?' . $urlQuery . '">' . $val . '</a>';
                $out .= '</li>';
            }
        }
        $out .= '
				 </ul>
			 </div>
			 </div>
		';
        echo $out;
        if ($stop) {
            echo '
			<!-- *** OUTPUT OF CLANG-VALIDATE - START *** -->
			' . rex_warning($I18N->msg('string_table_no_lang_perm')) . '
			<!-- *** OUTPUT OF CLANG-VALIDATE - END *** -->
			';
            require $REX['INCLUDE_PATH'] . "/layout/bottom.php";
            exit;
        }
    }
开发者ID:darwin26,项目名称:string_table,代码行数:59,代码来源:class.rex_string_table_utils.inc.php

示例5: enterObject

 function enterObject(&$email_elements, &$sql_elements, &$warning, &$form_output, $send = 0)
 {
     $multiple = FALSE;
     if (isset($this->elements[6]) && $this->elements[6] == 1) {
         $multiple = TRUE;
     }
     $size = (int) $this->getElement(7);
     if ($size < 1) {
         $size = 1;
     }
     $SEL = new rex_select();
     $SEL->setId("el_" . $this->getId());
     if ($multiple) {
         if ($size == 1) {
             $size = 2;
         }
         $SEL->setName($this->getFormFieldname() . "[]");
         $SEL->setSize($size);
         $SEL->setMultiple(1);
     } else {
         $SEL->setName($this->getFormFieldname());
         $SEL->setSize(1);
     }
     foreach (explode(',', $this->elements[3]) as $v) {
         $teile = explode('=', $v);
         $wert = $teile[0];
         if (isset($teile[1])) {
             $bezeichnung = $teile[1];
         } else {
             $bezeichnung = $teile[0];
         }
         $SEL->addOption(rex_translate($wert), $bezeichnung);
     }
     if (!$send && $this->value == "" && isset($this->elements[5]) && $this->elements[5] != "") {
         $this->value = $this->elements[5];
     }
     if (!is_array($this->getValue())) {
         $this->value = explode(",", $this->getValue());
     }
     foreach ($this->getValue() as $v) {
         $SEL->setSelected($v);
     }
     $this->value = implode(",", $this->getValue());
     $wc = "";
     if (isset($warning[$this->getId()])) {
         $wc = $warning[$this->getId()];
     }
     $SEL->setStyle(' class="select ' . $wc . '"');
     $form_output[$this->getId()] = '
   <p class="formselect formlabel-' . $this->getName() . '" id="' . $this->getHTMLId() . '">
   <label class="select ' . $wc . '" for="el_' . $this->getId() . '" >' . rex_translate($this->getElement(2)) . '</label>' . $SEL->get() . '</p>';
     $email_elements[$this->elements[1]] = $this->getValue();
     if (!isset($this->elements[4]) || $this->elements[4] != "no_db") {
         $sql_elements[$this->elements[1]] = $this->getValue();
     }
 }
开发者ID:rotzek,项目名称:redaxo_xform,代码行数:56,代码来源:class.xform.select.inc.php

示例6: getListValue

 static function getListValue($params)
 {
     $return = array();
     $new_select = new rex_xform_select();
     $values = $new_select->getArrayFromString($params['params']['field']['options']);
     foreach (explode(',', $params['value']) as $k) {
         if (isset($values[$k])) {
             $return[] = rex_translate($values[$k]);
         }
     }
     return implode('<br />', $return);
 }
开发者ID:alexbarnhill,项目名称:redaxo_xform,代码行数:12,代码来源:class.xform.select.inc.php

示例7: enterObject

 function enterObject()
 {
     global $I18N;
     $options[1] = $I18N->msg('xform_prio_top');
     $scopeWhere = $this->getScopeWhere();
     if (false === $scopeWhere) {
         $options[''] = $I18N->msg('xform_prio_bottom');
     } else {
         $this->preEditScopeWhere = $scopeWhere;
         $sql = rex_sql::factory();
         $fields = $this->getElement('fields');
         if (!is_array($fields)) {
             $fields = array_filter(explode(',', $fields));
         }
         if (empty($fields)) {
             $fields = array('id');
         }
         $selectFields = array();
         foreach ($fields as $field) {
             $selectFields[] = '`' . $sql->escape($field) . '`';
         }
         $sql->setQuery(sprintf('SELECT id, %s, `%s` as prio FROM `%s`%s ORDER BY `%2$s`', implode(', ', $selectFields), $sql->escape($this->getElement('name')), $sql->escape($this->params['main_table']), $scopeWhere));
         $prio = 1;
         while ($sql->hasNext()) {
             if ($sql->getValue('id') != $this->params['main_id']) {
                 $prio = $sql->getValue('prio') + 1;
                 $label = array();
                 foreach ($fields as $field) {
                     $label[] = rex_translate($sql->getValue($field), $I18N, false);
                 }
                 $options[$prio] = $I18N->msg('xform_prio_after', implode(' | ', $label));
             }
             $sql->next();
         }
     }
     if (!$this->params['send'] && $this->getValue() == '') {
         if ($this->getElement('default') == '') {
             $this->setValue(isset($prio) ? $prio : '');
         } else {
             $this->setValue($this->getElement('default'));
         }
     }
     if (!is_array($this->getValue())) {
         $this->setValue(explode(',', $this->getValue()));
     }
     $this->params['form_output'][$this->getId()] = $this->parse('value.select.tpl.php', array('options' => $options, 'multiple' => false, 'size' => 1));
     $this->setValue(implode(',', $this->getValue()));
     $this->params['value_pool']['email'][$this->getName()] = $this->getValue();
     $this->params['value_pool']['sql'][$this->getName()] = $this->getValue();
 }
开发者ID:alexbarnhill,项目名称:redaxo_xform,代码行数:50,代码来源:class.xform.prio.inc.php

示例8: rex_asd_news_language

function rex_asd_news_language($curClang, $urlParam)
{
    global $REX;
    global $I18N;
    reset($REX['CLANG']);
    $num_clang = count($REX['CLANG']);
    if ($num_clang > 1) {
        echo '
<div id="rex-clang" class="rex-toolbar">
    <div class="rex-toolbar-content">
        <ul>
            <li>' . $I18N->msg('languages') . ' : </li>';
        $stop = false;
        $i = 1;
        foreach ($REX['CLANG'] as $key => $val) {
            if ($i == 1) {
                echo '<li class="rex-navi-first rex-navi-clang-' . $key . '">';
            } else {
                echo '<li class="rex-navi-clang-' . $key . '">';
            }
            $val = rex_translate($val);
            if (!$REX['USER']->isAdmin() && !$REX['USER']->hasPerm('clang[all]') && !$REX['USER']->hasPerm('clang[' . $key . ']')) {
                echo '<span class="rex-strike">' . $val . '</span>';
                if ($curClang == $key) {
                    $stop = true;
                }
            } else {
                $class = '';
                if ($key == $curClang) {
                    $class = ' class="rex-active"';
                }
                echo '<a' . $class . ' href="index.php?page=' . $REX['PAGE'] . '&amp;clang=' . $key . $urlParam . '"' . rex_tabindex() . '>' . $val . '</a>';
            }
            echo '</li>';
            $i++;
        }
        echo '
        </ul>
    </div>
</div>';
        if ($stop) {
            echo rex_warning('You have no permission to this area');
            require $REX['INCLUDE_PATH'] . '/layout/bottom.php';
            exit;
        }
    }
}
开发者ID:Sysix,项目名称:asd_news,代码行数:47,代码来源:rex_asd_news_language.php

示例9: getListValue

 static function getListValue($params)
 {
     $return = array();
     $values = array();
     foreach (explode(',', $params['params']['field']['options']) as $v) {
         $entry = explode('=', $v);
         if (isset($entry[1])) {
             $values[$entry[1]] = rex_translate($entry[0]);
         } else {
             $values[$entry[0]] = rex_translate($entry[0]);
         }
         // .' ['.$entry[0].']';
     }
     foreach (explode(',', $params['value']) as $k) {
         if (isset($values[$k])) {
             $return[] = $values[$k];
         }
     }
     return implode('<br />', $return);
 }
开发者ID:Barnhiac,项目名称:MTW_REDAXO,代码行数:20,代码来源:class.xform.select.inc.php

示例10: executeAction

 function executeAction()
 {
     $text = $this->getElement(2);
     if ($text == '') {
         $text = $this->params['answertext'];
     }
     $text = rex_translate($text, null, false);
     if ($this->getElement(5) == '0') {
         $text = nl2br(htmlspecialchars($text));
     }
     if ($this->getElement(5) == '2') {
         $text = htmlspecialchars_decode($text);
         $text = str_replace('<br />', '', $text);
         $text = str_replace('&#039;', '\'', $text);
         $text = rex_a79_textile($text);
     }
     $text = $this->getElement(3) . $text . $this->getElement(4);
     foreach ($this->params['value_pool']['email'] as $search => $replace) {
         $text = str_replace('###' . $search . '###', $replace, $text);
     }
     $this->params['output'] = $text;
 }
开发者ID:alexbarnhill,项目名称:redaxo_xform,代码行数:22,代码来源:class.xform.action_showtext.inc.php

示例11: rex_a62_metaFields

/**
 * Erstellt den nötigen HTML Code um ein Formular zu erweitern
 *
 * @param $sqlFields rex_sql-objekt, dass die zu verarbeitenden Felder enthält
 * @param $activeItem objekt, dass mit getValue() die Werte des akuellen Eintrags zurückgibt
 * @param $formatCallback callback, dem die infos als Array übergeben werden und den formatierten HTML Text zurückgibt
 */
function rex_a62_metaFields($sqlFields, $activeItem, $formatCallback, $epParams)
{
    global $I18N, $REX;
    $s = '';
    // Startwert für MEDIABUTTON, MEDIALIST, LINKLIST zähler
    $media_id = 1;
    $mlist_id = 1;
    $link_id = 1;
    $llist_id = 1;
    $sqlFields->reset();
    for ($i = 0; $i < $sqlFields->getRows(); $i++, $sqlFields->next()) {
        // Umschliessendes Tag von Label und Formularelement
        $tag = 'p';
        $tag_attr = '';
        $name = $sqlFields->getValue('name');
        $title = $sqlFields->getValue('title');
        $params = $sqlFields->getValue('params');
        $typeLabel = $sqlFields->getValue('label');
        $attr = $sqlFields->getValue('attributes');
        $dblength = $sqlFields->getValue('dblength');
        $restrictions = $sqlFields->getValue('restrictions');
        $attr .= rex_tabindex();
        $attrArray = rex_split_string($attr);
        if (isset($attrArray['perm'])) {
            if (!$REX['USER']->hasPerm($attrArray['perm'])) {
                continue;
            }
            unset($attrArray['perm']);
        }
        $defaultValue = $sqlFields->getValue('default');
        if ($activeItem) {
            $itemValue = $activeItem->getValue($name);
            if (strpos($itemValue, '|+|') !== false) {
                // Alte notation mit |+| als Trenner
                $dbvalues = explode('|+|', $activeItem->getValue($name));
            } else {
                // Neue Notation mit | als Trenner
                $dbvalues = explode('|', $activeItem->getValue($name));
            }
        } else {
            $dbvalues = (array) $sqlFields->getValue('default');
        }
        if ($title != '') {
            $label = rex_translate($title);
        } else {
            $label = htmlspecialchars($name);
        }
        $id = preg_replace('/[^a-zA-Z\\-0-9_]/', '_', $label);
        $labelIt = true;
        $field = '';
        switch ($typeLabel) {
            case 'text':
                $tag_attr = ' class="rex-form-text"';
                $rexInput = rex_input::factory($typeLabel);
                $rexInput->addAttributes($attrArray);
                $rexInput->setAttribute('id', $id);
                $rexInput->setAttribute('name', $name);
                if ($dblength > 0) {
                    $rexInput->setAttribute('maxlength', $dblength);
                }
                if ($activeItem) {
                    $rexInput->setValue($activeItem->getValue($name));
                } else {
                    $rexInput->setValue($defaultValue);
                }
                $field = $rexInput->getHtml();
                break;
            case 'checkbox':
                // Beachte auch default values in multiple fields bei ADD.
                // Im EDIT wurde dies bereits vorher gehandelt
                if (!$activeItem) {
                    $defaultValue = explode('|', $defaultValue);
                }
                $name .= '[]';
            case 'radio':
                $values = array();
                if (rex_sql::getQueryType($params) == 'SELECT') {
                    $sql = rex_sql::factory();
                    $value_groups = $sql->getDBArray($params, MYSQL_NUM);
                    foreach ($value_groups as $value_group) {
                        if (isset($value_group[1])) {
                            $values[$value_group[1]] = $value_group[0];
                        } else {
                            $values[$value_group[0]] = $value_group[0];
                        }
                    }
                } else {
                    $value_groups = explode('|', $params);
                    foreach ($value_groups as $value_group) {
                        // check ob key:value paar
                        // und der wert beginnt nicht mit "translate:"
                        if (strpos($value_group, ':') !== false && strpos($value_group, 'translate:') !== 0) {
                            $temp = explode(':', $value_group, 2);
//.........这里部分代码省略.........
开发者ID:Barnhiac,项目名称:MTW_REDAXO,代码行数:101,代码来源:extension_common.inc.php

示例12: rex_select

                    $lang_a = new rex_select();
                    $lang_a->setId('clang_a');
                    $lang_a->setName('clang_a');
                    $lang_a->setSize('1');
                    $lang_a->setAttribute('tabindex', rex_tabindex(false));
                    foreach ($REX['CLANG'] as $key => $val) {
                        $val = rex_translate($val);
                        $lang_a->addOption($val, $key);
                    }
                    $lang_b = new rex_select();
                    $lang_b->setId('clang_b');
                    $lang_b->setName('clang_b');
                    $lang_b->setSize('1');
                    $lang_b->setAttribute('tabindex', rex_tabindex(false));
                    foreach ($REX['CLANG'] as $key => $val) {
                        $val = rex_translate($val);
                        $lang_b->addOption($val, $key);
                    }
                    $lang_a->setSelected(rex_request('clang_a', 'int', null));
                    $lang_b->setSelected(rex_request('clang_b', 'int', null));
                    echo '
                <fieldset>
                  <legend class="rex-lgnd">' . $I18N->msg('content_submitcopycontent') . '</legend>
  							  <div class="rex-fldst-wrppr">
									  <p>
											<label for="clang_a">' . $I18N->msg('content_contentoflang') . '</label>
											' . $lang_a->get() . '
											<label for="clang_b">' . $I18N->msg('content_to') . '</label>
											' . $lang_b->get() . '
									  </p>
									  <p>
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:31,代码来源:content.inc.php

示例13: rex_translate

/**
 * Übersetzt den text $text, falls dieser mit dem prefix "translate:" beginnt.
 */
function rex_translate($text, $I18N_Catalogue = null, $use_htmlspecialchars = true)
{
    if (!$I18N_Catalogue) {
        global $I18N;
        return rex_translate($text, $I18N, $use_htmlspecialchars);
    }
    $tranKey = 'translate:';
    $transKeyLen = strlen($tranKey);
    if (substr($text, 0, $transKeyLen) == $tranKey) {
        $text = $I18N_Catalogue->msg(substr($text, $transKeyLen));
    }
    if ($use_htmlspecialchars) {
        return htmlspecialchars($text);
    }
    return $text;
}
开发者ID:BackupTheBerlios,项目名称:redaxo,代码行数:19,代码来源:function_rex_other.inc.php

示例14: addSlice

    function addSlice($I_ID, $module_id)
    {
        global $REX, $I18N;
        $MOD = rex_sql::factory();
        $MOD->setQuery('SELECT * FROM ' . $REX['TABLE_PREFIX'] . "module WHERE id={$module_id}");
        if ($MOD->getRows() != 1) {
            $slice_content = rex_warning($I18N->msg('module_doesnt_exist'));
        } else {
            $initDataSql = rex_sql::factory();
            $REX_ACTION = array();
            foreach ($REX['VARIABLES'] as $obj) {
                $REX_ACTION = $obj->getACRequestValues($REX_ACTION);
            }
            // ----- PRE VIEW ACTION [ADD]
            $REX_ACTION = rex_execPreViewAction($module_id, 'add', $REX_ACTION);
            // ----- / PRE VIEW ACTION
            // ****************** Action Werte in Sql-Objekt uebernehmen
            foreach ($REX['VARIABLES'] as $obj) {
                $obj->setACValues($initDataSql, $REX_ACTION);
            }
            $moduleInput = $this->replaceVars($initDataSql, $MOD->getValue('eingabe'));
            $msg = '';
            if ($this->warning != '') {
                $msg .= rex_warning($this->warning);
            }
            if ($this->info != '') {
                $msg .= rex_info($this->info);
            }
            $slice_content = '
                <a id="addslice"></a>
                ' . $msg . '
                <div class="rex-form rex-form-content-editmode-add-slice">
                <form action="index.php#slice' . $I_ID . '" method="post" id="REX_FORM" enctype="multipart/form-data">
                    <fieldset class="rex-form-col-1">
                        <legend><span>' . $I18N->msg('add_block') . '</span></legend>
                        <input type="hidden" name="article_id" value="' . $this->article_id . '" />
                        <input type="hidden" name="page" value="content" />
                        <input type="hidden" name="mode" value="' . $this->mode . '" />
                        <input type="hidden" name="slice_id" value="' . $I_ID . '" />
                        <input type="hidden" name="function" value="add" />
                        <input type="hidden" name="module_id" value="' . $module_id . '" />
                        <input type="hidden" name="save" value="1" />
                        <input type="hidden" name="clang" value="' . $this->clang . '" />
                        <input type="hidden" name="ctype" value="' . $this->ctype . '" />

                        <div class="rex-content-editmode-module-name">
                            <h3 class="rex-hl4">
                                ' . $I18N->msg('module') . ': <span>' . htmlspecialchars(rex_translate($MOD->getValue('name'))) . '</span>
                            </h3>
                        </div>

                        <div class="rex-form-wrapper">

                            <div class="rex-form-row">
                                <div class="rex-content-editmode-slice-input">
                                <div class="rex-content-editmode-slice-input-2">
                                    ' . $moduleInput . '
                                </div>
                                </div>
                            </div>

                        </div>
                    </fieldset>

                    <fieldset class="rex-form-col-1">
                         <div class="rex-form-wrapper">
                            <div class="rex-form-row">
                                <p class="rex-form-col-a rex-form-submit">
                                    <input class="rex-form-submit" type="submit" name="btn_save" value="' . $I18N->msg('add_block') . '"' . rex_accesskey($I18N->msg('add_block'), $REX['ACKEY']['SAVE']) . ' />
                                </p>
                            </div>
                        </div>
                    </fieldset>
                </form>
                </div>
                <script type="text/javascript">
                     <!--
                    jQuery(function($) {
                        $(":input:visible:enabled:not([readonly]):first", $("#REX_FORM")).focus();
                    });
                     //-->
                </script>';
        }
        return $slice_content;
    }
开发者ID:Barnhiac,项目名称:MTW_REDAXO,代码行数:85,代码来源:class.rex_article_editor.inc.php

示例15: getArticle

    function getArticle($curctype = -1)
    {
        global $module_id, $REX_USER, $REX, $I18N;
        $this->ctype = $curctype;
        $sliceLimit = '';
        if ($this->getSlice) {
            //$REX['GG'] = 0;
            $sliceLimit = " AND " . $REX['TABLE_PREFIX'] . "article_slice.id = '" . $this->getSlice . "' ";
        }
        // ----- start: article caching
        ob_start();
        ob_implicit_flush(0);
        if ($REX['GG'] && !$this->viasql && !$this->getSlice) {
            if ($this->article_id != 0) {
                $this->contents = '';
                $article_content_file = $REX['INCLUDE_PATH'] . '/generated/articles/' . $this->article_id . '.' . $this->clang . '.content';
                if ($cont = rex_get_file_contents($article_content_file)) {
                    $this->contents = $cont;
                    eval($this->contents);
                }
            }
        } else {
            if ($this->article_id != 0) {
                // ---------- alle teile/slices eines artikels auswaehlen
                $sql = "SELECT " . $REX['TABLE_PREFIX'] . "module.id, " . $REX['TABLE_PREFIX'] . "module.name, " . $REX['TABLE_PREFIX'] . "module.ausgabe, " . $REX['TABLE_PREFIX'] . "module.eingabe, " . $REX['TABLE_PREFIX'] . "article_slice.*, " . $REX['TABLE_PREFIX'] . "article.re_id\r\n          FROM\r\n            " . $REX['TABLE_PREFIX'] . "article_slice\r\n          LEFT JOIN " . $REX['TABLE_PREFIX'] . "module ON " . $REX['TABLE_PREFIX'] . "article_slice.modultyp_id=" . $REX['TABLE_PREFIX'] . "module.id\r\n          LEFT JOIN " . $REX['TABLE_PREFIX'] . "article ON " . $REX['TABLE_PREFIX'] . "article_slice.article_id=" . $REX['TABLE_PREFIX'] . "article.id\r\n          WHERE\r\n            " . $REX['TABLE_PREFIX'] . "article_slice.article_id='" . $this->article_id . "' AND\r\n            " . $REX['TABLE_PREFIX'] . "article_slice.clang='" . $this->clang . "' AND\r\n            " . $REX['TABLE_PREFIX'] . "article.clang='" . $this->clang . "'\r\n            " . $sliceLimit . "\r\n            ORDER BY " . $REX['TABLE_PREFIX'] . "article_slice.re_article_slice_id";
                $this->CONT = new rex_sql();
                $this->CONT->debugsql = 0;
                $this->CONT->setQuery($sql);
                $RE_CONTS = array();
                $RE_CONTS_CTYPE = array();
                $RE_MODUL_OUT = array();
                $RE_MODUL_IN = array();
                $RE_MODUL_ID = array();
                $RE_MODUL_NAME = array();
                $RE_C = array();
                // ---------- SLICE IDS/MODUL SETZEN - speichern der daten
                for ($i = 0; $i < $this->CONT->getRows(); $i++) {
                    $RE_CONTS[$this->CONT->getValue('re_article_slice_id')] = $this->CONT->getValue($REX['TABLE_PREFIX'] . 'article_slice.id');
                    $RE_CONTS_CTYPE[$this->CONT->getValue('re_article_slice_id')] = $this->CONT->getValue($REX['TABLE_PREFIX'] . 'article_slice.ctype');
                    $RE_MODUL_IN[$this->CONT->getValue('re_article_slice_id')] = $this->CONT->getValue($REX['TABLE_PREFIX'] . 'module.eingabe');
                    $RE_MODUL_OUT[$this->CONT->getValue('re_article_slice_id')] = $this->CONT->getValue($REX['TABLE_PREFIX'] . 'module.ausgabe');
                    $RE_MODUL_ID[$this->CONT->getValue('re_article_slice_id')] = $this->CONT->getValue($REX['TABLE_PREFIX'] . 'module.id');
                    $RE_MODUL_NAME[$this->CONT->getValue('re_article_slice_id')] = $this->CONT->getValue($REX['TABLE_PREFIX'] . 'module.name');
                    $RE_C[$this->CONT->getValue('re_article_slice_id')] = $i;
                    $this->CONT->next();
                }
                // ---------- moduleselect: nur module nehmen auf die der user rechte hat
                if ($this->mode == 'edit') {
                    $MODULE = new rex_sql();
                    $MODULE->setQuery('select * from ' . $REX['TABLE_PREFIX'] . 'module order by name');
                    $MODULESELECT = new rex_select();
                    $MODULESELECT->setName('module_id');
                    $MODULESELECT->setSize('1');
                    $MODULESELECT->setAttribute('onchange', 'this.form.submit();');
                    $MODULESELECT->addOption('----------------------------  ' . $I18N->msg('add_block'), '');
                    for ($i = 0; $i < $MODULE->getRows(); $i++) {
                        if ($REX_USER->hasPerm('module[' . $MODULE->getValue('id') . ']') || $REX_USER->hasPerm('admin[]')) {
                            $MODULESELECT->addOption(rex_translate($MODULE->getValue('name'), NULL, FALSE), $MODULE->getValue('id'));
                        }
                        $MODULE->next();
                    }
                }
                // ---------- SLICE IDS SORTIEREN UND AUSGEBEN
                $I_ID = 0;
                $PRE_ID = 0;
                $LCTSL_ID = 0;
                $this->CONT->reset();
                $this->article_content = "";
                for ($i = 0; $i < $this->CONT->getRows(); $i++) {
                    // ----- ctype unterscheidung
                    if ($this->mode != "edit" && $i == 0) {
                        $this->article_content = "<?php if (\$this->ctype == '" . $RE_CONTS_CTYPE[$I_ID] . "' || (\$this->ctype == '-1')) { ?>";
                    }
                    // ------------- EINZELNER SLICE - AUSGABE
                    $this->CONT->counter = $RE_C[$I_ID];
                    $slice_content = "";
                    $SLICE_SHOW = TRUE;
                    if ($this->mode == "edit") {
                        $form_url = 'index.php';
                        if ($this->setanker) {
                            $form_url .= '#addslice';
                        }
                        $this->ViewSliceId = $RE_CONTS[$I_ID];
                        // ----- add select box einbauen
                        if ($this->function == "add" && $this->slice_id == $I_ID) {
                            $slice_content = $this->addSlice($I_ID, $module_id);
                        } else {
                            // ----- BLOCKAUSWAHL - SELECT
                            $MODULESELECT->setId("module_id" . $I_ID);
                            $slice_content = '
              <form action="' . $form_url . '" method="get" id="slice' . $RE_CONTS[$I_ID] . '">
                <fieldset>
                  <legend class="rex-lgnd"><span class="rex-hide">' . $I18N->msg("add_block") . '</span></legend>
                  <input type="hidden" name="article_id" value="' . $this->article_id . '" />
                  <input type="hidden" name="page" value="content" />
                  <input type="hidden" name="mode" value="' . $this->mode . '" />
                  <input type="hidden" name="slice_id" value="' . $I_ID . '" />
                  <input type="hidden" name="function" value="add" />
                  <input type="hidden" name="clang" value="' . $this->clang . '" />
                  <input type="hidden" name="ctype" value="' . $this->ctype . '" />
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:101,代码来源:class.rex_article.inc.php


注:本文中的rex_translate函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。