* * @author Oliver Georgi <*****@*****.**> * @copyright Copyright (c) 2002-2015, Oliver Georgi * @license http://opensource.org/licenses/GPL-2.0 GNU GPL-2 * @link http://www.phpwcms.de * **/ // ---------------------------------------------------------------- // obligate check for phpwcms constants if (!defined('PHPWCMS_ROOT')) { die("You Cannot Access This Script Directly, Have a Nice Day."); } // ---------------------------------------------------------------- //search form // necessary JavaScript libraries initMootools(); initMootoolsAutocompleter(); if (empty($content['search']["text_html"])) { $content['search']["text_html"] = 0; } $content['search']["search_news"] = empty($content['search']["search_news"]) ? 0 : 1; if (!isset($content['search']["news_lang"])) { $content['search']["news_lang"] = array(); } if (!isset($content['search']["news_category"])) { $content['search']["news_category"] = array(); } if (!isset($content['search']["news_andor"])) { $content['search']["news_andor"] = 'OR'; } if (empty($content['search']["news_url"])) {
* phpwcms content management system * * @author Oliver Georgi <*****@*****.**> * @copyright Copyright (c) 2002-2015, Oliver Georgi * @license http://opensource.org/licenses/GPL-2.0 GNU GPL-2 * @link http://www.phpwcms.de * **/ // ---------------------------------------------------------------- // obligate check for phpwcms constants if (!defined('PHPWCMS_ROOT')) { die("You Cannot Access This Script Directly, Have a Nice Day."); } // ---------------------------------------------------------------- // Plain Text initMootools('1.2'); $GLOBALS['BE']['HEADER']['flext.js'] = getJavaScriptSourceLink(TEMPLATE_PATH . 'lib/mootools/plugin-1.2/mootools.flext.js'); if (empty($content['ctext_format'])) { $content['ctext_format'] = 'plain'; } ?> <tr><td colspan="2" class="rowspacer0x7"><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr> <tr> <td align="right" class="chatlist"><?php echo $BL['be_admin_struct_template']; ?> : </td> <td><select name="template" id="template"> <?php echo '<option value="">' . $BL['be_admin_tmpl_default'] . '</option>' . LF;
function backend_language_parser() { global $phpwcms, $BE, $BL; if (!$phpwcms['be_parse_lang_process'] || empty($phpwcms['be_lang_parse'])) { return backend_language_replace(''); } elseif (empty($phpwcms['allowed_lang']) || !is_array($phpwcms['allowed_lang']) || count($phpwcms['allowed_lang']) < 2) { return backend_language_replace(''); } else { $parse_mode = strtoupper($phpwcms['be_lang_parse']); if (!in_array($parse_mode, array('BBCODE', 'BRACECODE'))) { // i18n later return backend_language_replace(''); } } // cut main backend content innerHTML $html_pos1 = strpos($BE['HTML'], '<!--BE_MAIN_CONTENT_START//-->'); $html_pos2 = strpos($BE['HTML'], '<!--BE_MAIN_CONTENT_END//-->'); if ($html_pos1 !== false && $html_pos2 !== false) { $html_pos1 += strlen('<!--BE_MAIN_CONTENT_START//-->'); $html_pos2 -= 1; } $html = trim(preg_replace('/\\s+/', ' ', substr($BE['HTML'], $html_pos1, $html_pos2 - $html_pos1))); $BE['HTML'] = substr($BE['HTML'], 0, $html_pos1) . substr($BE['HTML'], $html_pos2); // load MooTools too if (empty($phpwcms['mootools_mode'])) { initMootools(); } // init language replacements $regexp = array('search' => array(), 'replace' => array()); $bracket = array('BBCODE_OPEN' => '[', 'BRACECODE_OPEN' => '{', 'BBCODE_CLOSE' => ']', 'BRACECODE_CLOSE' => '}'); $cookie = empty($_COOKIE['phpwcms_be_parse_lang']) || !in_array($_COOKIE['phpwcms_be_parse_lang'], $phpwcms['allowed_lang']) ? false : $_COOKIE['phpwcms_be_parse_lang']; // init menu $menu = array('<ul id="be_lang">', '<li class="be-lang-label chatlist">' . $BL['be_profile_label_lang'] . ':</li>', '<li><a href="#" class="be-disabled' . ($cookie === false ? ' be-active' : '') . '" rel="disabled" title="' . $BL['be_profile_label_lang'] . ': ' . $BL['be_off'] . '">' . $BL['be_off'] . '</a></li>'); // Header CSS section $BE['HEADER']['be_parse_lang'] = ' <style type="text/css">' . LF; // JavaScript section $BE['BODY_CLOSE']['hidden_main_content'] = ' <script type="text/javascript">' . LF; $BE['BODY_CLOSE']['hidden_main_content'] .= "\t\tvar be_lang_html = [];" . LF; $BE['BODY_CLOSE']['hidden_main_content'] .= "\t\tvar cur_be_lang = 'disabled';" . LF; $BE['BODY_CLOSE']['hidden_main_content'] .= "\t\tbe_lang_html['disabled'] = '" . trim(str_replace(array("\\", "'"), array("\\\\", "\\'"), $html)) . "';" . LF . LF; // build regular expression at first foreach ($phpwcms['allowed_lang'] as $lang) { $regexp['search'][$lang] = '/\\' . $bracket[$parse_mode . '_OPEN'] . $lang . '\\' . $bracket[$parse_mode . '_CLOSE'] . '(.*?)\\' . $bracket[$parse_mode . '_OPEN'] . '\\/' . $lang . '\\' . $bracket[$parse_mode . '_CLOSE'] . '/is'; $regexp['replace'][$lang] = ''; } // parse each language at second foreach ($phpwcms['allowed_lang'] as $lang) { $replace = $regexp['replace']; $replace[$lang] = '$1'; $lang_html = preg_replace($regexp['search'], $replace, $html); $BE['HEADER']['be_parse_lang'] .= ' #be_lang a.be-lang-' . $lang . ' {background-image:url(img/famfamfam/lang/' . $lang . '.png);}' . LF; $menu_item = '<li><a href="#" class="be-lang be-lang-' . $lang; // check which is current default if ($lang == $cookie) { $new_html = $lang_html; // phpwcms should use the curent lang html $BE['BODY_CLOSE']['hidden_main_content'] .= "\t\tcur_be_lang = '" . $lang . "';" . LF; $menu_item .= ' be-active'; } $menu[] = $menu_item . '" rel="' . $lang . '" title="' . $BL['be_profile_label_lang'] . ': ' . strtoupper($lang) . '">' . $lang . '</a></li>'; $BE['BODY_CLOSE']['hidden_main_content'] .= "\t\tbe_lang_html['" . $lang . "'] = '" . trim(str_replace(array("\\", "'"), array("\\\\", "\\'"), $lang_html)) . "';" . LF . LF; } $BE['HEADER']['be_parse_lang'] .= ' </style>'; $BE['BODY_CLOSE']['hidden_main_content'] .= ' window.addEvent("domready", function() {' . LF; $BE['BODY_CLOSE']['hidden_main_content'] .= ' var be_lang = $("be_lang");' . LF; $BE['BODY_CLOSE']['hidden_main_content'] .= ' var be_lang_cnt = $("be_lang_cnt");' . LF; $BE['BODY_CLOSE']['hidden_main_content'] .= ' if(be_lang && be_lang_cnt) {' . LF; $BE['BODY_CLOSE']['hidden_main_content'] .= ' var be_lang_items = be_lang.getElements("a");' . LF; $BE['BODY_CLOSE']['hidden_main_content'] .= ' be_lang_items.each(function(l) {' . LF; $BE['BODY_CLOSE']['hidden_main_content'] .= ' l.addEvent("click", function(){' . LF; $BE['BODY_CLOSE']['hidden_main_content'] .= "\t\t\t\t\tif(cur_be_lang == l.rel) {return;}" . LF; $BE['BODY_CLOSE']['hidden_main_content'] .= "\t\t\t\t\tcur_be_lang = l.rel;" . LF; $BE['BODY_CLOSE']['hidden_main_content'] .= ' be_lang_items.each(function(el){el.removeClass("be-active");});' . LF; $BE['BODY_CLOSE']['hidden_main_content'] .= ' l.addClass("be-active");' . LF; $BE['BODY_CLOSE']['hidden_main_content'] .= ' be_lang_cnt.setHTML(be_lang_html[l.rel]);' . LF; $BE['BODY_CLOSE']['hidden_main_content'] .= ' Cookie.set("phpwcms_be_parse_lang", cur_be_lang);' . LF; $BE['BODY_CLOSE']['hidden_main_content'] .= ' });' . LF; $BE['BODY_CLOSE']['hidden_main_content'] .= ' });' . LF; $BE['BODY_CLOSE']['hidden_main_content'] .= ' }' . LF; $BE['BODY_CLOSE']['hidden_main_content'] .= ' });' . LF; $BE['BODY_CLOSE']['hidden_main_content'] .= ' </script>'; $menu[] = '</ul>'; // wrap current lang/html with <div> $BE['HTML'] = replace_tmpl_section('BE_MAIN_CONTENT', $BE['HTML'], '<div id="be_lang_cnt">' . (empty($new_html) ? $html : $new_html) . '</div>'); backend_language_replace(implode(LF, $menu)); }
$BE['HEADER']['datepicker'] .= "days: " . $BLM['days'] . ", "; $BE['HEADER']['datepicker'] .= "months: " . $BLM['months'] . ", "; $BE['HEADER']['datepicker'] .= '});});' . LF; $BE['HEADER']['datepicker'] .= ' </script>'; $plugin['date_select_loaded'] = true; } echo '<tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="5" /></td></tr>' . LF; echo '<tr>' . LF; echo '<td align="right" class="chatlist">' . $BLM[$key] . ': </td>' . LF; echo '<td><input name="' . $key . '" type="text" id="' . $key . '" class="v12 dateselect" value="' . html($plugin['data'][$key]) . '" size="30" maxlength="10" /></td>' . LF; echo '</tr>' . LF; break; case 'DECIMAL': // needs MooTools 1.2 and MooTools More if (empty($plugin['meio.mask_loaded'])) { initMootools('1.2', array('Element/Element.Forms')); // need MooTools More and Element.Forms $BE['HEADER']['Meio.Mask.min.js'] = getJavaScriptSourceLink(TEMPLATE_PATH . 'lib/meio.mask/Meio.Mask.min.js'); $BE['HEADER']['meio.mask'] = ' <script type="text/javascript">' . LF; $BE['HEADER']['meio.mask'] .= ' window.addEvent("domready", function() { var meiomasks_eur = $$("input.decimal-eur"); var meiomasks_int = $$("input.decimal-int"); var meiomasks_cent = $$("input.decimal-cent"); if(meiomasks_eur.length > 0) { meiomasks_eur.each(function(el){ el.meiomask("' . $BLM['meio.mask'] . '", { autoEmpty: true, autoTab: true, alignText: true, decimal: "' . $BLM['price_dec_point'] . '", thousands: "' . $BLM['price_thousands_sep'] . '",
function getPagination() { initMootools(); $paginate = '<input type="hidden" name="page" id="filterPage" value="' . $this->filter_page . '" />'; if ($this->limit > 0 && $this->news_total > $this->limit) { $current_page = $this->filter_page + 1; $max_page = ceil($this->news_total / $this->limit); if ($current_page > $max_page) { $current_page = $max_page; $this->filter_page = $max_page - 1; $this->start_at = $this->filter_page * $this->limit; } $prev_page = $this->filter_page - 1; if ($prev_page < 0) { $prev_page = 0; } $next_page = $current_page; if ($next_page >= $max_page) { $next_page = $max_page - 1; } $paginate .= '<img src="img/famfamfam/action_back.gif" alt="" border="0"'; if ($current_page == 1) { $paginate .= ' class="inactive"'; } else { $paginate .= ' onclick="$(\'filterPage\').value=' . $prev_page . ';$(\'paginate\').submit();"'; } $paginate .= ' /></td><td class="chatlist nowrap">'; $paginate .= ' <b>' . $current_page . '</b>/' . $max_page . ' '; $paginate .= '</td><td class="nowrap"><img src="img/famfamfam/action_forward.gif" alt="" border="0"'; if ($current_page == $max_page) { $paginate .= ' class="inactive"'; } else { $paginate .= ' onclick="$(\'filterPage\').value=' . $next_page . ';$(\'paginate\').submit();"'; } $paginate .= ' />'; } else { $this->start_at = 0; $this->filter_page = 0; } return $paginate; }