/** * AdmBlock_settings(). * Setup the config vars and output the block settings. * Returns the css classes they are used. */ function pmxc_AdmBlock_settings() { global $context, $txt; // define the settings options echo ' <td valign="top" style="padding:4px;"> <div style="min-height:195px;"> <input type="hidden" name="config[settings]" value="" /> <input type="hidden" name="config[static_block]" value="1" />'; // show the settings screen echo ' <div class="cat_bar catbg_grid grid_padd"> <h4 class="catbg catbg_grid"><span class="cat_left_title">' . sprintf($txt['pmx_blocks_settings_title'], $this->register_blocks[$this->cfg['blocktype']]['description']) . '</span></h4> </div> <div class="adm_input adm_sel"> <span>' . $txt['pmx_catblock_cats'] . '</span> <select style="width:83%" name="config[settings][category]" size="1">'; // output cats foreach ($context['pmx']['catorder'] as $order) { $cat = PortaMx_getCatByOrder($this->categories, $order); echo ' <option value="' . $cat['name'] . '"' . (isset($this->cfg['config']['settings']['category']) && $this->cfg['config']['settings']['category'] == $cat['name'] ? ' selected="selected"' : '') . '>' . str_repeat('•', $cat['level']) . ' ' . $cat['name'] . '</option>'; } echo ' </select> </div>'; // show mode (titelbar/frame) $this->cfg['config']['settings']['usedframe'] = !isset($this->cfg['config']['settings']['usedframe']) ? 'block' : $this->cfg['config']['settings']['usedframe']; echo ' <div class="adm_check"> <span class="adm_w80">' . $txt['pmx_catblock_blockframe'] . '</span> <div><input class="input_check" type="radio" name="config[settings][usedframe]" value="block"' . (isset($this->cfg['config']['settings']['usedframe']) && $this->cfg['config']['settings']['usedframe'] == 'block' ? ' checked="checked"' : '') . ' /></div> </div> <div class="adm_check"> <span class="adm_w80">' . $txt['pmx_catblock_catframe'] . '</span> <div><input class="input_check" type="radio" name="config[settings][usedframe]" value="cat"' . (isset($this->cfg['config']['settings']['usedframe']) && $this->cfg['config']['settings']['usedframe'] == 'cat' ? ' checked="checked"' : '') . ' /></div> </div> <div class="adm_check"> <span class="adm_w80">' . $txt['pmx_catblock_inherit'] . ' <img class="info_toggle" onclick=\'Show_help("pmxcatH01")\' src="' . $context['pmx_imageurl'] . 'information.png" alt="*" title="' . $txt['pmx_information_icon'] . '" /> </span> <input type="hidden" name="config[settings][inherit_acs]" value="0" /> <div><input class="input_check" type="checkbox" name="config[settings][inherit_acs]" value="1"' . (!empty($this->cfg['config']['settings']['inherit_acs']) ? ' checked="checked"' : '') . ' /></div> </div> <div id="pmxcatH01" class="info_frame" style="margin-top:4px;">' . $txt['pmx_catblock_inherithelp'] . '</div> <input type="hidden" name="config[show_sitemap]" value="0" /> </div>'; // return the used classnames return PortaMx_getdefaultClass(false, true); // default classdef }
/** * Output the Category config screen */ function pmxc_ShowAdmCategoryConfig() { global $context, $settings, $txt; echo ' <tr> <td> <div class="windowbg"> <table class="pmx_table"> <tr> <td style="width;50%;padding:4px;"> <input type="hidden" name="id" value="' . $this->cfg['id'] . '" /> <input type="hidden" name="parent" value="' . $this->cfg['parent'] . '" /> <input type="hidden" name="level" value="' . $this->cfg['level'] . '" /> <input type="hidden" name="catorder" value="' . $this->cfg['catorder'] . '" /> <input type="hidden" name="config[settings]" value="" /> <input type="hidden" name="check_num_vars[]" value="[config][maxheight], \'\'" /> <div style="height:61px;"> <div style="float:left;width:100px; padding-top:1px;">' . $txt['pmx_categories_title'] . '</div>'; // all titles depend on language $curlang = ''; foreach ($context['pmx']['languages'] as $lang => $sel) { $curlang = !empty($sel) ? $lang : $curlang; echo ' <span id="' . $lang . '" style="white-space:nowrap;' . (!empty($sel) ? '' : ' display:none;') . '"> <input style="width:65%;" type="text" name="config[title][' . $lang . ']" value="' . (isset($this->cfg['config']['title'][$lang]) ? htmlspecialchars($this->cfg['config']['title'][$lang], ENT_QUOTES) : '') . '" /> </span>'; } echo ' <input id="curlang" type="hidden" value="' . $curlang . '" /> <div style="clear:both; height:10px;"> <img style="float:left;" src="' . $context['pmx_imageurl'] . 'arrow_down.gif" alt="*" title="" /> </div> <div style="float:left; width:100px;">' . $txt['pmx_edit_title_lang'] . ' <img class="info_toggle" onclick=\'Show_help("pmxBH01")\' src="' . $context['pmx_imageurl'] . 'information.png" alt="*" title="' . $txt['pmx_information_icon'] . '" /> </div> <select style="float:left; width:165px;" size="1" onchange="setTitleLang(this)">'; foreach ($context['pmx']['languages'] as $lang => $sel) { echo ' <option value="' . $lang . '"' . (!empty($sel) ? ' selected="selected"' : '') . '>' . $lang . '</option>'; } echo ' </select> <div style="margin-left:280px;"> <span style="vertical-align:6px;">' . $txt['pmx_edit_title_align'] . '</span>'; // title align if (!isset($this->cfg['config']['title_align'])) { $this->cfg['config']['title_align'] = 'left'; } echo ' <input type="hidden" id="titlealign" name="config[title_align]" value="' . $this->cfg['config']['title_align'] . '" />'; foreach ($txt['pmx_edit_title_align_types'] as $key => $val) { echo ' <img id="img' . $key . '" src="' . $context['pmx_imageurl'] . 'text_align_' . $key . '.gif" alt="*" title="' . $txt['pmx_edit_title_helpalign'] . $val . '" style="cursor:pointer;vertical-align:1px;' . ($this->cfg['config']['title_align'] == $key ? 'background-color:#e02000;' : '') . '" onclick="setAlign(\'\', \'' . $key . '\')" />'; } echo ' </div> </div> <div id="pmxBH01" style="margin-top:4px;" class="info_frame">' . $txt['pmx_edit_titlehelp'] . ' </div>'; // Title icons $this->cfg['config']['title_icon'] = empty($this->cfg['config']['title_icon']) || $this->cfg['config']['title_icon'] == 'none.gif' ? 'none.png' : $this->cfg['config']['title_icon']; echo ' <div style="float:left;height:40px;"> <div style="float:left;width:100px; padding-top:8px;">' . $txt['pmx_edit_titleicon'] . '</div> <div class="ttliconDiv" onclick="setNewIcon(document.getElementById(\'pWind.icon_sel\'), event)"> <input id="post_image" type="hidden" name="config[title_icon]" value="' . $this->cfg['config']['title_icon'] . '" /> <input id="iconDD" value="' . ucfirst(str_replace('.png', '', $this->cfg['config']['title_icon'])) . '" readonly /> <img id="pWind.icon" class="pwindiconBlk" src="' . $context['pmx_Iconsurl'] . $this->cfg['config']['title_icon'] . '" alt="*" /> <img class="ddImageBlk" src="' . $context['pmx_imageurl'] . 'state_expanded.png" alt="*" title="" /> </div> <ul class="ttlicondd Artedit" id="pWind.icon_sel" onclick="updIcon(this)">'; foreach ($this->title_icons as $file => $name) { echo ' <li id="' . $file . '" class="ttlicon' . ($this->cfg['config']['title_icon'] == $file ? ' active' : '') . '"> <img src="' . $context['pmx_Iconsurl'] . $file . '" alt="*" /><span>' . $name . '</span> </li>'; } echo ' </ul> <script>$("li").hover(function(){$(this).toggleClass("active")});</script> </div>'; // show article types echo ' </td> <td style="padding:4px;">'; // show placement for new categories if ($context['pmx']['subaction'] == 'editnew') { if (!empty($this->categories)) { echo ' <div style="padding-top:4px;"> <div style="float:left; width:145px;">' . $txt['pmx_categories_type'] . '</div>'; $opt = 0; foreach ($txt['pmx_categories_places'] as $artType => $artDesc) { echo ' <input id="pWind.place.' . $opt . '" class="input_check" type="radio" name="catplace" value="' . $artType . '"' . ($artType == 'after' ? ' checked="checked"' : '') . ' /><span style="vertical-align:3px; padding:0 3px;">' . $artDesc . '</span>'; $opt++; } // all exist categories echo ' </div> <div style="float:left; width:150px;padding-top:11px;padding-bottom:8px;">' . $txt['pmx_categories_cats'] . '</div> <select style="width:53%;margin-top:10px;margin-bottom:8px;" size="1" name="catid">'; // output cats foreach ($context['pmx']['catorder'] as $order) { $cat = PortaMx_getCatByOrder($this->categories, $order); echo ' <option value="' . $cat['id'] . '"' . ($this->cfg['id'] == $cat['id'] ? ' selected="selected"' : '') . '>' . str_repeat('•', $cat['level']) . ' ' . $cat['name'] . '</option>'; } echo ' </select>'; } else { echo ' <input type="hidden" name="catid" value="0" /> <input type="hidden" name="catplace" value="0" />'; } } // category name echo ' <div class="adm_clear" style="float:left;width:150px; padding-top:3px;">' . $txt['pmx_categories_name'] . ': <img class="info_toggle" onclick=\'Show_help("pmxBH11")\' src="' . $context['pmx_imageurl'] . 'information.png" alt="*" title="' . $txt['pmx_information_icon'] . '" /> </div> <span id="check.name.error" style="display:none;">' . sprintf($txt['namefielderror'], $txt['pmx_categories_name']) . '</span> <input id="check.name" style="width:53%; margin-top:1px;" onkeyup="check_requestname(this)" onkeypress="check_requestname(this)" type="text" name="name" value="' . $this->cfg['name'] . '" /> <div id="pmxBH11" class="info_frame" style="margin-top:5px;">' . $txt['pmx_edit_pagenamehelp'] . ' </div> </div> </td> </tr> <tr> <td style="padding:4px;width:50%;"> <input type="hidden" name="config[settings]" value="" />'; // show the settings area echo ' <div class="cat_bar catbg_grid grid_padd"> <h4 class="catbg catbg_grid"><span class="cat_left_title">' . $txt['pmx_categories_settings_title'] . '</span></h4> </div>'; // show mode (titelbar/frame) foreach ($txt['pmx_categories_showmode'] as $key => $value) { echo ' <div class="adm_check" style="min-height:38px;"> <img align="left" src="' . $context['pmx_imageurl'] . 'ca_frame_' . $key . '.png" alt="*" /> <div style="float:left; width:72%; padding:0 10px;">' . $value . '</div> <input style="float:right;margin-right:20px;" name="config[settings][framemode]" class="input_radio" type="radio" value="' . $key . '"' . ($this->cfg['config']['settings']['framemode'] == $key ? ' checked="checked"' : '') . ' /> </div>'; } // show mode also for articles echo ' <div class="adm_check" style="height:20px;"> <div style="float:left; width:82%;">' . $txt['pmx_categories_visual'] . '</div> <input style="float:right;margin-right:20px;" name="config[settings][catstyle]" type="checkbox" class="input_check" value="1"' . (!empty($this->cfg['config']['settings']['catstyle']) ? ' checked="checked"' : '') . ' /> </div>'; // show mode (sidebar) echo ' <div class="adm_check" style="height:20px;"> <div style="float:left; width:82%;">' . $txt['pmx_categories_modsidebar'] . '</div> <input id="shm.sidebar" style="float:right;margin-right:20px;" onclick="check_PageMode(this, \'pages\')" name="config[settings][showmode]" class="input_radio" type="radio" value="sidebar"' . ($this->cfg['config']['settings']['showmode'] == 'sidebar' ? ' checked="checked"' : '') . ' /> </div>'; // show mode (pages) echo ' <div class="adm_check" style="height:20px;"> <div style="float:left; width:82%;">' . $txt['pmx_categories_modpage'] . '</div> <input id="shm.pages" style="float:right;margin-right:20px;" onclick="check_PageMode(this, \'sidebar\')" name="config[settings][showmode]" class="input_radio" type="radio" value="pages"' . ($this->cfg['config']['settings']['showmode'] == 'pages' ? ' checked="checked"' : '') . ' /> </div>'; // options for SideBar mode echo ' <div id="opt.sidebar" class="adm_clear" style="padding-top:0px;' . ($this->cfg['config']['settings']['showmode'] == 'pages' ? ' display:none;' : '') . '"> <div style="height:25px;margin-top:0px;"> <div style="float:left; width:80%;">' . $txt['pmx_categories_sidebarwith'] . '</div> <input style="float:right;margin-right:20px;margin-top:-2px;" onkeyup="check_numeric(this)" type="text" size="3" name="config[settings][sidebarwidth]" value="' . (!empty($this->cfg['config']['settings']['sidebarwidth']) ? $this->cfg['config']['settings']['sidebarwidth'] : '') . '" /> </div> <div style="height:25px;margin-top:0px;"> <div style="float:left;">' . $txt['pmx_categories_sidebaralign'] . '</div> <div style="float:right; margin-right:20px;margin-top:0px;"> <input class="input_radio" type="radio" name="config[settings][sbmalign]" value="1"' . (!empty($this->cfg['config']['settings']['sbmalign']) ? ' checked="checked"' : '') . ' /><span style="display:inline-block;margin-top:2px;">' . $txt['pmx_categories_sbalign'][0] . ' </span> <input class="input_radio" type="radio" name="config[settings][sbmalign]" value="0"' . (empty($this->cfg['config']['settings']['sbmalign']) ? ' checked="checked"' : '') . ' /><span style="display:inline-block;margin-top:2px;">' . $txt['pmx_categories_sbalign'][1] . '</span> </div> </div> <div style="height:21px;margin-top:0px;"> <div style="float:left; width:82%;">' . $txt['pmx_categories_addsubcats'] . '</div> <input type="hidden" name="config[settings][addsubcats]" value="0" /> <input style="float:right;margin-right:20px;" type="checkbox" class="input_check" name="config[settings][addsubcats]" value="1"' . (!empty($this->cfg['config']['settings']['addsubcats']) ? ' checked="checked"' : '') . ' /> </div> </div>'; // options for Pages mode echo ' <div id="opt.pages" class="adm_clear" style="padding-top:0px;' . ($this->cfg['config']['settings']['showmode'] == 'sidebar' ? 'display:none;' : '') . '"> <div style="height:20px;"> <div style="float:left;width:80%;">' . $txt['pmx_categories_modpage_count'] . '</div> <input style="float:right;margin-right:20px;margin-top:-2px;" onkeyup="check_numeric(this)" type="text" size="3" name="config[settings][pages]" value="' . (!empty($this->cfg['config']['settings']['pages']) ? $this->cfg['config']['settings']['pages'] : '') . '" /> </div> <div style="height:20px;margin-top:7px;"> <div style="float:left;width:80%;">' . $txt['pmx_categories_modpage_pageindex'] . '</div> <input style="float:right;margin-right:20px;" type="checkbox" class="input_check" name="config[settings][pageindex]" value="1"' . (!empty($this->cfg['config']['settings']['pageindex']) ? ' checked="checked"' : '') . ' /> </div> <div style="height:20px;margin-top:5px;"> <div style="float:left; width:82%;">' . $txt['pmx_categories_showsubcats'] . '</div> <input type="hidden" name="config[settings][showsubcats]" value="0" /> <input id="opt.pages.sbar.check" style="float:right;margin-right:20px;" type="checkbox" class="input_check" name="config[settings][showsubcats]" value="1"' . (!empty($this->cfg['config']['settings']['showsubcats']) ? ' checked="checked"' : '') . ' onclick="set_PageMode(this)" /> </div> </div> <div id="opt.pages.sbar" class="adm_clear" style="padding-top:2px;' . ($this->cfg['config']['settings']['showmode'] == 'pages' && !empty($this->cfg['config']['settings']['showsubcats']) ? '' : 'display:none;') . '"> <div style="height:23px;margin-top:3px;"> <div style="float:left; width:80%;">' . $txt['pmx_categories_sidebarwith'] . '</div> <input style="float:right;margin-right:20px;" onkeyup="check_numeric(this)" type="text" size="3" name="config[settings][catsbarwidth]" value="' . (!empty($this->cfg['config']['settings']['catsbarwidth']) ? $this->cfg['config']['settings']['catsbarwidth'] : '') . '" /> </div> <div style="height:20px;margin-top:3px;"> <div style="float:left;">' . $txt['pmx_categories_sidebaralign'] . '</div> <div style="float:right; margin-right:20px;margin-top:0px;"> <input class="input_radio" type="radio" name="config[settings][sbpalign]" value="1"' . (!empty($this->cfg['config']['settings']['sbpalign']) ? ' checked="checked"' : '') . ' /><span style="vertical-align:2px;">' . $txt['pmx_categories_sbalign'][0] . ' </span> <input class="input_radio" type="radio" name="config[settings][sbpalign]" value="0"' . (empty($this->cfg['config']['settings']['sbpalign']) ? ' checked="checked"' : '') . ' /><span style="vertical-align:2px;">' . $txt['pmx_categories_sbalign'][1] . '</span> </div> </div> </div> <div class="adm_check" style="height:20px; padding-top:4px;"> <div style="float:left; width:82%;"> <img class="info_toggle" align="right style="padding:2px 5px;" onclick=\'Show_help("pmxCH06")\' src="' . $context['pmx_imageurl'] . 'information.png" alt="*" title="' . $txt['pmx_information_icon'] . '" /> ' . $txt['pmx_categorie_inherit'] . ' </div> <input style="float:right;margin-right:20px;" name="config[settings][inherit_acs]" class="input_check" type="checkbox" value="1"' . (!empty($this->cfg['config']['settings']['inherit_acs']) ? ' checked="checked"' : '') . ' /> </div> <div id="pmxCH06" class="info_frame">' . $txt['pmx_categories_inherithelp'] . '</div>'; // article sort echo ' <div class="adm_clear" style="padding-top:4px; height:70px;"> <div style="float:left; width:150px;"> <img class="info_toggle" align="right style="padding:2px 5px;" onclick=\'Show_help("pmxCH05")\' src="' . $context['pmx_imageurl'] . 'information.png" alt="*" title="' . $txt['pmx_information_icon'] . '" /> ' . $txt['pmx_categorie_articlesort'] . ' </div> <select style="float:right;margin-right:20px; width:45%;margin-top:3px;" name="artsort[]" id="pmxartsort" onchange="changed(\'pmxartsort\');" size="4" multiple="multiple">'; if (!empty($this->cfg['artsort'])) { $sortdata = array(); $sortval = Pmx_StrToArray($this->cfg['artsort']); foreach ($sortval as $sort) { @(list($k, $v) = Pmx_StrToArray($sort, '=')); $sortdata[$k] = $v; } } else { $sortdata = array('id' => 1); } foreach ($txt['pmx_categories_artsort'] as $key => $value) { echo ' <option value="' . $key . '=' . (array_key_exists($key, $sortdata) ? $sortdata[$key] . '" selected="selected' : '1') . '">' . (array_key_exists($key, $sortdata) ? $sortdata[$key] == '0' ? '^' : '' : '') . $value . '</option>'; } echo ' </select> </div> <div class"adm_clear"></div> <div id="pmxCH05" class="info_frame">' . $txt['pmx_categories_sorthelp'] . '</div> <script type="text/javascript"> var pmxartsort = new MultiSelect("pmxartsort"); </script>'; // Categorie for common use echo ' <input type="hidden" name="config[check_ecl]" value="0" /> <input type="hidden" name="config[check_eclbots]" value="0" /> <div class="cat_bar catbg_grid grid_padd" style="margin-top:10px;"> <h4 class="catbg catbg_grid"><span class="cat_left_title">' . $txt['pmx_categories_globalcat'] . '</span></h4> </div> <div class="adm_check" style="min-height:25px;"> <span class="adm_w80">' . $txt['pmx_categorie_global'] . ' <img class="info_toggle" onclick=\'Show_help("pmxHCAT02")\' src="' . $context['pmx_imageurl'] . 'information.png" alt="*" title="' . $txt['pmx_information_icon'] . '" /> </span> <input class="input_check" style="float:right; margin-right:20px;" type="checkbox" name="config[global]" value="1"' . (!empty($this->cfg['config']['global']) ? ' checked="checked"' : '') . ' /> <div id="pmxHCAT02" class="info_frame" style="margin-top:4px;">' . $txt['pmx_categories_gloablcathelp'] . '</div> </div> <div class="adm_check" style="min-height:25px;"> <span class="adm_w80">' . $txt['pmx_categorie_request'] . ' <img class="info_toggle" onclick=\'Show_help("pmxHCAT03")\' src="' . $context['pmx_imageurl'] . 'information.png" alt="*" title="' . $txt['pmx_information_icon'] . '" /> </span> <input class="input_check" style="float:right; margin-right:20px;" type="checkbox" name="config[request]" value="1"' . (!empty($this->cfg['config']['request']) ? ' checked="checked"' : '') . ' /> <div id="pmxHCAT03" class="info_frame" style="margin-top:4px;">' . $txt['pmx_categorie_requesthelp'] . '</div> </div> <div class="adm_check" style="min-height:25px;"> <span class="adm_w80">' . $txt['pmx_check_catelcmode'] . ' <img class="info_toggle" onclick=\'Show_help("pmxCateclHelp")\' src="' . $context['pmx_imageurl'] . 'information.png" alt="*" title="' . $txt['pmx_information_icon'] . '" /> </span> <input class="input_check" style="float:right; margin-right:20px;" type="checkbox" name="config[check_ecl]" value="1"' . (!empty($this->cfg['config']['check_ecl']) ? ' checked="checked"' : '') . ' onclick="showeclbots(this)" /> </div> <div id="pmxCateclHelp" class="info_frame" style="margin-top:0;">' . $txt['pmx_cat_eclcheckhelp'] . '</div> <div class="adm_check" id="eclextend" style="min-height:25px;display:' . (!empty($this->cfg['config']['check_ecl']) ? 'block' : 'none') . '"> <span class="adm_w80">' . $txt['pmx_check_catelcbots'] . ' <img class="info_toggle" onclick=\'Show_help("pmxeclHelpbots")\' src="' . $context['pmx_imageurl'] . 'information.png" alt="*" title="' . $txt['pmx_information_icon'] . '" /> </span> <input id="eclextendinp" class="input_check" style="float:right; margin-right:20px;" type="checkbox" name="config[check_eclbots]" value="1"' . (!empty($this->cfg['config']['check_eclbots']) ? ' checked="checked"' : '') . ' /> </div> <div id="pmxeclHelpbots" class="info_frame" style="margin-top:0;">' . $txt['pmx_cat_eclcheckbotshelp'] . '</div> <script type="text/javascript"> function showeclbots(elm) {if(elm.checked == true) document.getElementById("eclextend").style.display = "block"; else {document.getElementById("eclextend").style.display = "none"; document.getElementById("eclextendinp").checked = false;}} </script> </td>'; // the visual options echo ' <td id="set_col" style="padding:4px;"> <div class="cat_bar catbg_grid grid_padd"> <h4 class="catbg catbg_grid"><span class="cat_left_title">' . $txt['pmx_edit_visuals'] . '</span></h4> </div> <div style="float:left; height:30px; width:177px;">' . $txt['pmx_edit_cancollapse'] . '</div> <input style="padding-left:141px;" type="hidden" name="config[collapse]" value="0" /> <input class="input_check" id="collapse" type="checkbox" name="config[collapse]" value="1"' . ($this->cfg['config']['visuals']['header'] == 'none' ? ' disabled="disabled"' : ($this->cfg['config']['collapse'] == 1 ? ' checked="checked"' : '')) . ' /> <div style="clear:both;" /></div> <div style="float:left; height:30px; width:180px;">' . $txt['pmx_edit_collapse_state'] . '</div> <select style="width:46%;" size="1" name="config[collapse_state]">'; foreach ($txt['pmx_collapse_mode'] as $key => $text) { echo ' <option value="' . $key . '"' . (isset($this->cfg['config']['collapse_state']) && $this->cfg['config']['collapse_state'] == $key ? ' selected="selected"' : '') . '>' . $text . '</option>'; } echo ' </select> <br style="clear:both;" /> <div style="float:left; height:30px; width:180px;">' . $txt['pmx_edit_overflow'] . '</div> <select style="width:46%;" size="1" id="mxhgt" name="config[overflow]" onchange="checkMaxHeight(this);">'; foreach ($txt['pmx_overflow_actions'] as $key => $text) { echo ' <option value="' . $key . '"' . (isset($this->cfg['config']['overflow']) && $this->cfg['config']['overflow'] == $key ? ' selected="selected"' : '') . '>' . $text . '</option>'; } echo ' </select> <br style="clear:both;" /> <div style="float:left; min-height:30px; width:99%;"> <div style="float:left; min-height:30px; width:180px;">' . $txt['pmx_edit_height'] . '</div> <div style="float:left; width:46%"> <input onkeyup="check_numeric(this)" id="maxheight" type="text" size="4" name="config[maxheight]" value="' . (isset($this->cfg['config']['maxheight']) ? $this->cfg['config']['maxheight'] : '') . '"' . (!isset($this->cfg['config']['overflow']) || empty($this->cfg['config']['overflow']) ? ' disabled="disabled"' : '') . ' /><span class="smalltext">' . $txt['pmx_pixel'] . '</span><span style="display:inline-block; width:3px;"></span> <select id="maxheight_sel" style="float:right;width:52%;margin-right:-1%;" size="1" name="config[height]">'; foreach ($txt['pmx_edit_height_mode'] as $key => $text) { echo ' <option value="' . $key . '"' . (isset($this->cfg['config']['height']) && $this->cfg['config']['height'] == $key ? ' selected="selected"' : '') . '>' . $text . '</option>'; } echo ' </select> </div> </div> <br style="clear:both;" /> <script type="text/javascript"> checkMaxHeight(document.getElementById("mxhgt")); </script> <div style="float:left; height:30px; width:180px;">' . $txt['pmx_edit_innerpad'] . '</div> <input onkeyup="check_numeric(this, \',\')" type="text" size="4" name="config[innerpad]" value="' . (isset($this->cfg['config']['innerpad']) ? $this->cfg['config']['innerpad'] : '4') . '" /><span class="smalltext">' . $txt['pmx_pixel'] . ' (xy/y,x)</span> <br style="clear:both;" />'; // CSS class settings echo ' <div class="cat_bar catbg_grid grid_padd"> <h4 class="catbg catbg_grid grid_botpad"> <div style="float:left; width:174px;"><span class="cat_left_title">' . $txt['pmx_edit_usedclass_type'] . '</span></div> <span class="cat_left_title">' . $txt['pmx_edit_usedclass_style'] . '</span> </h4> </div> <div style="margin:0px 2px;">'; // write out the classes foreach ($this->usedClass as $ucltyp => $ucldata) { echo ' <div style="float:left; width:176px; height:30px; padding-top:2px;">' . $ucltyp . '</div> <select' . ($ucltyp == 'frame' || $ucltyp == 'postframe' ? ' id="pmx_' . $ucltyp . '" ' : ' ') . 'style="width:46%;" name="config[visuals][' . $ucltyp . ']" onchange="checkCollapse(this)">'; foreach ($ucldata as $cname => $class) { echo ' <option value="' . $class . '"' . (!empty($this->cfg['config']['visuals'][$ucltyp]) ? $this->cfg['config']['visuals'][$ucltyp] == $class ? ' selected="selected"' : '' : (substr($cname, 0, 1) == '+' ? ' selected="selected"' : '')) . '>' . substr($cname, 1) . '</option>'; } echo ' </select> <br style="clear:both;" />'; } echo ' </div> <div class="cat_bar catbg_grid grid_padd" style="margin-top:-2px;"> <h4 class="catbg catbg_grid"><span class="cat_left_title">' . $txt['pmx_edit_canhavecssfile'] . '</span></h4> </div> <div style="float:left; margin:0px 2px; width:176px;">' . $txt['pmx_edit_cssfilename'] . '</div> <select id="sel.css.file" style="width:46%;margin-bottom:2px;" name="config[cssfile]" onchange="pmxChangeCSS(this)"> <option value=""></option>'; // custon css files exist ? if (!empty($this->custom_css)) { // write out custom mpt/css definitions foreach ($this->custom_css as $custcss) { if (is_array($custcss)) { echo ' <option value="' . $custcss['file'] . '"' . ($this->cfg['config']['cssfile'] == $custcss['file'] ? ' selected="selected"' : '') . '>' . $custcss['file'] . '</option>'; } } echo ' </select> <div style="clear:both; height:2px;"></div>'; // write out all class definitions (hidden) foreach ($this->custom_css as $custcss) { if (is_array($custcss)) { echo ' <div id="' . $custcss['file'] . '" style="display:none;">'; foreach ($custcss['class'] as $key => $val) { if (in_array($key, array_keys($this->usedClass))) { echo ' <div style="float:left; width:176px; padding:0 2px;">' . $key . '</div>' . (empty($val) ? sprintf($txt['pmx_edit_nocss_class'], $settings['theme_id']) : $val) . '<br />'; } } echo ' </div>'; } } echo ' <script type="text/javascript"> var elm = document.getElementById("sel.css.file"); var fname = elm.options[elm.selectedIndex].value; if(document.getElementById(fname)) document.getElementById(fname).style.display = ""; function pmxChangeCSS(elm) { for(i=0; i<elm.length; i++) { if(document.getElementById(elm.options[i].value)) document.getElementById(elm.options[i].value).style.display = "none"; } var fname = elm.options[elm.selectedIndex].value; if(document.getElementById(fname)) document.getElementById(fname).style.display = ""; } </script>'; } else { echo ' </select> <div style="clear:both; height:6px;"></div>'; } // the group access echo ' <div class="adm_clear cat_bar catbg_grid grid_padd" style="margin-top:2px;"> <h4 class="catbg catbg_grid" style="margin-left:173px;"> <img class="grid_click_image pmxleft" onclick=\'Show_help("pmxBH03")\' src="' . $context['pmx_imageurl'] . 'information.png" alt="*" title="' . $txt['pmx_information_icon'] . '" /> <span class="cat_msg_title">' . $txt['pmx_categories_groups'] . '</span> </h4> </div> <select name="acsgrp[]" id="pmxgroups" onchange="changed(\'pmxgroups\');" style="width:47%;margin-left:178px;" multiple="multiple" size="5">'; if (!empty($this->cfg['acsgrp'])) { list($grpacs, $denyacs) = Pmx_StrToArray($this->cfg['acsgrp'], ',', '='); } else { $grpacs = $denyacs = array(); } foreach ($this->smf_groups as $grp) { echo ' <option value="' . $grp['id'] . '=' . intval(!in_array($grp['id'], $denyacs)) . '"' . (in_array($grp['id'], $grpacs) ? ' selected="selected"' : '') . '>' . (in_array($grp['id'], $denyacs) ? '^' : '') . $grp['name'] . '</option>'; } echo ' </select> <div id="pmxBH03" class="info_frame" style="margin-top:5px;">' . $txt['pmx_categories_groupshelp'] . '</div> <script type="text/javascript"> var pmxgroups = new MultiSelect("pmxgroups"); </script> </td> </tr> <tr> <tr> <td colspan="2" style="text-align:center;padding:4px 4px 0 4px;"><hr class="pmx_hr" /> <div style="padding-top: 5px;"> <input class="button_submit" type="button" style="margin-right:10px;" value="' . $txt['pmx_save_exit'] . '" onclick="FormFuncCheck(\'save_edit\', \'1\')" /> <input class="button_submit" type="button" style="margin-right:10px;" value="' . $txt['pmx_save_cont'] . '" onclick="FormFuncCheck(\'save_edit_continue\', \'1\')" /> <input class="button_submit" type="button" style="margin-right:10px;" value="' . $txt['pmx_cancel'] . '" onclick="FormFunc(\'cancel_edit\', \'1\')" /> </div> </td> </tr> </table> </div> </td> </tr>'; }
/** * Insert categories **/ function pmx_insert_cat($place, $id, $category) { global $smcFunc, $pmxCacheFunc; // get max catorder $request = $smcFunc['db_query']('', ' SELECT MAX(catorder) FROM {db_prefix}portamx_categories', array()); list($maxorder) = $smcFunc['db_fetch_row']($request); $smcFunc['db_free_result']($request); // category table empty? if (empty($maxorder)) { $category['catorder'] = 1; return $category; } // handle the placement $allcats = PortaMx_getCategories(); if ($category['id'] == $id) { $placeCat = $category; } else { $placeCat = PortaMx_getCatByID($allcats, $id); } // insert before if ($place == 'before') { $category['catorder'] = $placeCat['catorder']; $category['parent'] = $placeCat['parent']; $category['level'] = $placeCat['level']; } elseif ($place == 'after') { $lastFnd = $placeCat; if (($placeCat['level'] < $category['level'] || $placeCat['level'] == 0) && is_array($placeCat['childs'])) { while (is_array($lastFnd['childs']) || !empty($lastFnd['parent'])) { $lastFnd = PortaMx_getCatByOrder($allcats, PortaMx_getNextCat($lastFnd['catorder'])); } } else { $lastFnd['catorder'] = PortaMx_getNextCat($lastFnd['catorder']); } if (empty($lastFnd)) { $category['catorder'] = $maxorder + 1; $category['parent'] = 0; $category['level'] = 0; } else { $category['catorder'] = $lastFnd['catorder']; $category['parent'] = $placeCat['parent']; $category['level'] = $placeCat['level']; } unset($lastFnd); } elseif ($place == 'child') { $category['catorder'] = PortaMx_getNextCat($placeCat['catorder']); $category['parent'] = $placeCat['id']; $category['level'] = $placeCat['level'] + 1; } // shiftup the catorder $smcFunc['db_query']('', ' UPDATE {db_prefix}portamx_categories SET catorder = catorder + 1 WHERE catorder >= {int:corder}', array('corder' => $category['catorder'])); // cleanup.. unset($allcats); unset($placeCat); // clear cache $pmxCacheFunc['clean'](); return $category; }
/** * Get category and his childs */ function getCatsAndChilds($cats, $acs, $acs_inherit = false) { global $context, $smcFunc; $catIDs = array(); $catNames = array(); $this->categories = array(); $corder = $cats['catorder']; $cat = PortaMx_getCatByOrder(array($cats), $corder); while (is_array($cat)) { if (!is_array($cat['config'])) { $cat['config'] = unserialize($cat['config']); } // check ecl if (empty($cat['config']['check_ecl']) || !empty($cat['config']['check_ecl']) && pmx_checkECL_Cookie(!empty($cat['config']['check_eclbots']))) { if (!empty($cat['artsum'])) { // get custom css if set if (!empty($cat['config']['cssfile'])) { $this->getCustomCSS($cat); } // inherit acs from block? if (!empty($acs_inherit)) { $cat['acsgrp'] = $acs; } if (allowPmxGroup($cat['acsgrp'])) { $ttl = $this->getUserTitle($cat); if (empty($ttl)) { $ttl = htmlspecialchars($cat['name'], ENT_QUOTES); } $this->categories[$cat['name']] = array('id' => $cat['id'], 'name' => $cat['name'], 'artsort' => $cat['artsort'], 'acsgrp' => $cat['acsgrp'], 'config' => $cat['config'], 'side' => $this->cfg['side'], 'blocktype' => 'category', 'customclass' => '', 'title' => $ttl); $catIDs[] = $cat['id']; $catNames[$cat['id']] = $cat['name']; } } } else { break; } $addSub = !empty($cat['config']['settings']['addsubcats']) && $cat['config']['settings']['showmode'] == 'sidebar' || !empty($cat['config']['settings']['showsubcats']) && $cat['config']['settings']['showmode'] == 'pages'; if (!empty($addSub)) { $corder = PortaMx_getNextCat($corder); $cat = PortaMx_getCatByOrder(array($cats), $corder); } else { break; } } if (!empty($catIDs)) { // get articles for any cat $request = $smcFunc['db_query']('', ' SELECT a.id, a.name, a.acsgrp, a.catid, a.ctype, a.config, a.owner, a.active, a.created, a.updated, a.approved, a.content, CASE WHEN m.real_name = {string:empty} THEN m.member_name ELSE m.real_name END AS mem_name FROM {db_prefix}portamx_articles AS a LEFT JOIN {db_prefix}members AS m ON (a.owner = m.id_member) WHERE a.catid IN ({array_int:cats}) AND a.active > 0 AND a.approved > 0 ORDER BY a.id', array('cats' => $catIDs, 'empty' => '')); while ($row = $smcFunc['db_fetch_assoc']($request)) { $row['config'] = unserialize($row['config']); // check ecl if (empty($row['config']['check_ecl']) || !empty($row['config']['check_ecl']) && pmx_checkECL_Cookie(!empty($row['config']['check_eclbots']))) { if (!empty($this->categories[$catNames[$row['catid']]]['config']['settings']['inherit_acs'])) { $row['acsgrp'] = $this->categories[$catNames[$row['catid']]]['acsgrp']; } if (allowPmxGroup($row['acsgrp'])) { if (!empty($this->categories[$catNames[$row['catid']]]['config']['settings']['catstyle'])) { $row['config']['visuals'] = $this->categories[$catNames[$row['catid']]]['config']['visuals']; $row['config']['cssfile'] = $this->categories[$catNames[$row['catid']]]['config']['cssfile']; } $row['side'] = $this->cfg['side']; $row['blocktype'] = !empty($this->cfg['config']) ? 'static_article' : 'article'; $row['member_name'] = $row['mem_name']; // get custom css if set if (!empty($row['config']['cssfile'])) { $this->getCustomCSS($row); } $this->articles[$catNames[$row['catid']]][] = $row; } } } $smcFunc['db_free_result']($request); } // articles found? $ccats = $this->categories; foreach ($ccats as $cname => $cdata) { if (!empty($this->articles[$cname])) { $this->articles[$cname] = PortaMx_ArticleSort($this->articles[$cname], $this->categories[$cname]['artsort']); // if article reqested, get the tile if (!empty($this->postarray[$this->postKey]['art']) && $cname == (empty($this->postarray[$this->postKey]['child']) ? $this->postarray[$this->postKey]['cat'] : $this->postarray[$this->postKey]['child'])) { foreach ($this->articles[$cname] as $art) { if ($art['name'] == $this->postarray[$this->postKey]['art']) { $context['pmx']['pagenames']['art'] = $this->getUserTitle($art); if (empty($context['pmx']['pagenames']['art'])) { $context['pmx']['pagenames']['art'] = htmlspecialchars($art['name'], ENT_QUOTES); } break; } } } } else { unset($this->categories[$cname]); } } }
/** * Output the Article config screen */ function pmxc_ShowAdmArticleConfig() { global $context, $settings, $modSettings, $boarddir, $options, $txt; echo ' <tr> <td> <div class="windowbg"> <table class="pmx_table"> <tr> <td style="width:50%;padding:4px;"> <input type="hidden" name="id" value="' . $this->cfg['id'] . '" /> <input type="hidden" name="owner" value="' . $this->cfg['owner'] . '" /> <input type="hidden" name="contenttype" value="' . $this->cfg['ctype'] . '" /> <input type="hidden" name="config[settings]" value="" /> <input type="hidden" name="active" value="' . $this->cfg['active'] . '" /> <input type="hidden" name="approved" value="' . $this->cfg['approved'] . '" /> <input type="hidden" name="approvedby" value="' . $this->cfg['approvedby'] . '" /> <input type="hidden" name="created" value="' . $this->cfg['created'] . '" /> <input type="hidden" name="updated" value="' . $this->cfg['updated'] . '" /> <input type="hidden" name="updatedby" value="' . $this->cfg['updatedby'] . '" /> <input type="hidden" name="check_num_vars[]" value="[config][maxheight], \'\'" /> <div style="height:61px;"> <div style="float:left;width:100px; padding-top:1px;">' . $txt['pmx_article_title'] . '</div>'; // all titles depend on language $curlang = ''; foreach ($context['pmx']['languages'] as $lang => $sel) { $curlang = !empty($sel) ? $lang : $curlang; echo ' <span id="' . $lang . '" style="white-space:nowrap;' . (!empty($sel) ? '' : ' display:none;') . '"> <input style="width:65%;" type="text" name="config[title][' . $lang . ']" value="' . (isset($this->cfg['config']['title'][$lang]) ? htmlspecialchars($this->cfg['config']['title'][$lang], ENT_QUOTES) : '') . '" /> </span>'; } echo ' <input id="curlang" type="hidden" value="' . $curlang . '" /> <div style="clear:both; height:10px;"> <img style="float:left;" src="' . $context['pmx_imageurl'] . 'arrow_down.gif" alt="*" title="" /> </div> <div style="float:left; width:100px;">' . $txt['pmx_edit_title_lang'] . ' <img class="info_toggle" onclick=\'Show_help("pmxBH01")\' src="' . $context['pmx_imageurl'] . 'information.png" alt="*" title="' . $txt['pmx_information_icon'] . '" /> </div> <select style="float:left; width:165px;" size="1" onchange="setTitleLang(this)">'; foreach ($context['pmx']['languages'] as $lang => $sel) { echo ' <option value="' . $lang . '"' . (!empty($sel) ? ' selected="selected"' : '') . '>' . $lang . '</option>'; } echo ' </select> <div style="margin-left:280px;"> <span style="vertical-align:6px;">' . $txt['pmx_edit_title_align'] . '</span>'; // title align if (!isset($this->cfg['config']['title_align'])) { $this->cfg['config']['title_align'] = 'left'; } echo ' <input type="hidden" id="titlealign" name="config[title_align]" value="' . $this->cfg['config']['title_align'] . '" />'; foreach ($txt['pmx_edit_title_align_types'] as $key => $val) { echo ' <img id="img' . $key . '" src="' . $context['pmx_imageurl'] . 'text_align_' . $key . '.gif" alt="*" title="' . $txt['pmx_edit_title_helpalign'] . $val . '" style="cursor:pointer;vertical-align:1px;' . ($this->cfg['config']['title_align'] == $key ? 'background-color:#e02000;' : '') . '" onclick="setAlign(\'\', \'' . $key . '\')" />'; } echo ' </div> </div> <div id="pmxBH01" style="margin-top:4px;" class="info_frame">' . $txt['pmx_edit_titlehelp'] . ' </div>'; // Title icons $this->cfg['config']['title_icon'] = empty($this->cfg['config']['title_icon']) || $this->cfg['config']['title_icon'] == 'none.gif' ? 'none.png' : $this->cfg['config']['title_icon']; echo ' <div style="float:left;height:40px;"> <div style="float:left;width:100px; padding-top:8px;">' . $txt['pmx_edit_titleicon'] . '</div> <div class="ttliconDiv" onclick="setNewIcon(document.getElementById(\'pWind.icon_sel\'), event)"> <input id="post_image" type="hidden" name="config[title_icon]" value="' . $this->cfg['config']['title_icon'] . '" /> <input id="iconDD" value="' . ucfirst(str_replace('.png', '', $this->cfg['config']['title_icon'])) . '" readonly /> <img id="pWind.icon" class="pwindiconBlk" src="' . $context['pmx_Iconsurl'] . $this->cfg['config']['title_icon'] . '" alt="*" /> <img class="ddImageBlk" src="' . $context['pmx_imageurl'] . 'state_expanded.png" alt="*" title="" /> </div> <ul class="ttlicondd Artedit" id="pWind.icon_sel" onclick="updIcon(this)">'; foreach ($this->title_icons as $file => $name) { echo ' <li id="' . $file . '" class="ttlicon' . ($this->cfg['config']['title_icon'] == $file ? ' active' : '') . '"> <img src="' . $context['pmx_Iconsurl'] . $file . '" alt="*" /><span>' . $name . '</span> </li>'; } echo ' </ul> <script>$("li").hover(function(){$(this).toggleClass("active")});</script> </div>'; // show article types echo ' </td> <td style="padding:4px;"> <div style="float:left;width:130px;">' . $txt['pmx_article_type'] . '</div>'; $RegBlocks = $context['pmx']['RegBlocks']; foreach ($RegBlocks as $key => $val) { if (!in_array($key, array('html', 'script', 'bbc_script', 'php'))) { unset($RegBlocks[$key]); } } function cmpBDesc($a, $b) { return strcasecmp(str_replace(' ', '', $a["description"]), str_replace(' ', '', $b["description"])); } uasort($RegBlocks, 'cmpBDesc'); if (allowPmx('pmx_admin, pmx_create')) { echo ' <select style="width:60%;" size="1" name="ctype" onchange="FormFunc(\'edit_change\', \'1\')">'; foreach ($RegBlocks as $type => $articleType) { echo ' <option value="' . $type . '"' . ($this->cfg['ctype'] == $type ? ' selected="selected"' : '') . '>' . $articleType['description'] . '</option>'; } echo ' </select>'; } else { echo ' <input type="hidden" name="ctype" value="' . $this->cfg['ctype'] . '" /> <input style="width:60%;" value="' . $RegBlocks[$this->cfg['ctype']]['description'] . '" disabled="disabled" />'; } // all exist categories $selcats = array_merge(array(PortaMx_getDefaultCategory($txt['pmx_categories_none'])), $this->categories); $ordercats = array_merge(array(0), $context['pmx']['catorder']); $isWriter = allowPmx('pmx_create, pmx_articles', true); $isAdm = allowPmx('pmx_admin'); echo ' <div style="float:left;width:130px;margin-top:9px;">' . $txt['pmx_article_cats'] . '</div> <select style="width:60%;margin-top:9px;" size="1" name="catid">'; foreach ($ordercats as $catorder) { $cat = PortaMx_getCatByOrder($selcats, $catorder); $cfg = unserialize($cat['config']); if (!empty($isAdm) || !empty($isWriter) && empty($cfg['global'])) { echo ' <option value="' . $cat['id'] . '"' . ($cat['id'] == $this->cfg['catid'] ? ' selected="selected"' : '') . '">' . str_repeat('•', $cat['level']) . ' ' . $cat['name'] . '</option>'; } } echo ' </select> </div>'; // articlename echo ' <div style="float:left;width:130px;margin-top:9px">' . $txt['pmx_article_name'] . ' <img class="info_toggle" onclick=\'Show_help("pmxBH11")\' src="' . $context['pmx_imageurl'] . 'information.png" alt="*" title="' . $txt['pmx_information_icon'] . '" /> </div> <input id="check.name" style="width:60%;margin-top:9px" onkeyup="check_requestname(this)" onkeypress="check_requestname(this)" type="text" name="name" value="' . $this->cfg['name'] . '" /> <span id="check.name.error" style="display:none;">' . sprintf($txt['namefielderror'], $txt['pmx_article_name']) . '</span> <div id="pmxBH11" class="info_frame" style="margin-top:5px;">' . $txt['pmx_edit_pagenamehelp'] . ' </div> </td> </tr>'; // the editor area dependent on article type echo ' <tr> <td colspan="2" style="padding:4px 4px 10px 4px;">'; // show the editor if ($this->cfg['ctype'] == 'html') { $allow = allowPmx('pmx_admin') || allowPmx('pmx_blocks'); $fnd = explode('/', str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT'])); $smfpath = str_replace('\\', '/', $boarddir); foreach ($fnd as $key => $val) { $fnd[$key] = $val; $rep[] = ''; } $filepath = trim(str_replace($fnd, $rep, $smfpath), '/') . '/CustomImages'; if (count($fnd) == count(explode('/', $smfpath))) { $filepath = '/' . $filepath; } $_SESSION['pmx_ckfm'] = array('ALLOW' => $allow, 'FILEPATH' => $filepath); echo ' <div class="cat_bar catbg_grid"> <h4 class="catbg catbg_grid"><span class="cat_left_title">' . $txt['pmx_edit_content'] . '</span></h4> </div> <textarea name="' . $context['pmx']['htmledit']['id'] . '">' . $context['pmx']['htmledit']['content'] . '</textarea> <script type="text/javascript"> CKEDITOR.replace("' . $context['pmx']['htmledit']['id'] . '", {filebrowserBrowseUrl: "ckeditor/fileman/index.php"}); </script>'; } elseif ($this->cfg['ctype'] == 'bbc_script') { echo ' <style type="text/css"> .sceditor-container iframe{width:99.1% !important;} .sceditor-container{max-width:inherit;width:inherit !important; margin-right:-2px;} textarea{max-width:99% !important;width:99.2% !important;} </style> <div class="cat_bar catbg_grid" style="margin-right:1px;"> <h4 class="catbg catbg_grid"><span class="cat_left_title">' . $txt['pmx_edit_content'] . '</span></h4> </div> <input type="hidden" id="smileyset" value="PortaMx" /> <div id="bbcBox_message"></div> <div id="smileyBox_message"></div> <div style="padding-right:3px;margin-top:-10px;">', template_control_richedit($context['pmx']['editorID'], 'smileyBox_message', 'bbcBox_message'), '</div>'; } elseif ($this->cfg['ctype'] == 'php') { $options['collapse_phpinit'] = empty($context['pmx']['phpInit']['havecont']); echo ' <div class="cat_bar catbg_grid"> <h4 class="catbg catbg_grid"> <span style="float:right;display:block;margin-top:-2px;"> <img onclick="php_syntax(\'' . $context['pmx']['phpShow']['id'] . '\')" style="padding:3px 5px 3px 10px;cursor:pointer;" alt="Syntax check" title="' . $txt['pmx_check_phpsyntax'] . '" src="' . $context['pmx_imageurl'] . 'syntaxcheck.png" class="pmxright" /> </span> <span class="cat_left_title">' . $txt['pmx_edit_content'] . ' <span id="upshrinkPHPinitCont"' . (empty($options['collapse_phpinit']) ? '' : ' style="display:none;"') . '>' . $txt['pmx_edit_content_show'] . '</span></span> </h4> </div> <div id="check_' . $context['pmx']['phpShow']['id'] . '" class="info_frame" style="line-height:1.4em;margin:1px 0;"></div> <textarea name="' . $context['pmx']['phpShow']['id'] . '" id="' . $context['pmx']['phpShow']['id'] . '" style="display:block;resize:vertical;width:' . $context['pmx']['phpShow']['width'] . ';height:' . $context['pmx']['phpShow']['height'] . ';">' . $context['pmx']['phpShow']['value'] . '</textarea> <div class="plainbox info_text" style="margin-top:5px;margin-right:0px;padding:5px 0 7px 0;display:block;"> <div class="normaltext" style="margin:0 10px;"> ' . (empty($context['pmx']['phpInit']['havecont']) ? '<span style="margin-top:2px;margin-right:-4px;" id="upshrinkPHPshowImg" class="floatright ' . (empty($options['collapse_visual']) ? 'toggle_up" align="bottom"' : 'toggle_down" align="bottom"') . ' title="' . (empty($options['collapse_visual']) ? $txt['pmx_collapse'] : $txt['pmx_expand']) . $txt['pmx_php_partblock'] . '"> </span>' : '') . ' <span>' . $txt['pmx_php_partblock_note'] . ' <img class="info_toggle" onclick=\'Toggle_help("pmxPHPH01")\' src="' . $context['pmx_imageurl'] . 'information.png" alt="*" title="' . $txt['pmx_information_icon'] . '" style="vertical-align: -3px;" /> </span> </div> <div id="pmxPHPH01" style="display:none; margin:4px 10px 0;">' . $txt['pmx_php_partblock_help'] . '</div> </div> <div id="upshrinkPHPshowCont"' . (empty($options['collapse_phpinit']) ? '' : ' style="margin-top:5px;display:none;"') . '> <div class="cat_bar catbg_grid"> <h4 class="catbg catbg_grid"> <span style="float:right;display:block;margin-top:-2px;"> <img onclick="php_syntax(\'' . $context['pmx']['phpInit']['id'] . '\')" style="padding:3px 5px 3px 10px;cursor:pointer;" title="' . $txt['pmx_check_phpsyntax'] . '" alt="Syntax check" src="' . $context['pmx_imageurl'] . 'syntaxcheck.png" class="pmxright" /> </span> <span class="cat_left_title">' . $txt['pmx_edit_content'] . $txt['pmx_edit_content_init'] . '</span> </h4> </div> <div id="check_' . $context['pmx']['phpInit']['id'] . '" class="info_frame" style="line-height:1.4em;margin:1px 0;"></div> <textarea name="' . $context['pmx']['phpInit']['id'] . '" id="' . $context['pmx']['phpInit']['id'] . '" style="display:block;width:' . $context['pmx']['phpInit']['width'] . ';height:' . $context['pmx']['phpInit']['height'] . ';">' . $context['pmx']['phpInit']['value'] . '</textarea> </div>'; if (empty($context['pmx']['phpInit']['havecont'])) { addInlineJavascript("\t" . str_replace("\n", "\n\t", PortaMx_compressJS(' var upshrinkPHPshow = new smc_Toggle({ bToggleEnabled: true, bCurrentlyCollapsed: ' . (empty($options['collapse_phpinit']) ? 'false' : 'true') . ', aSwappableContainers: [ \'upshrinkPHPshowCont\', \'upshrinkPHPinitCont\' ], aSwapImages: [ { sId: \'upshrinkPHPshowImg\', altCollapsed: ' . JavaScriptEscape($txt['pmx_expand'] . $txt['pmx_php_partblock']) . ', altExpanded: ' . JavaScriptEscape($txt['pmx_collapse'] . $txt['pmx_php_partblock']) . ' } ], oCookieOptions: { bUseCookie: false } });')), true); } } else { echo ' <div class="cat_bar catbg_grid"> <h4 class="catbg catbg_grid"><span class="cat_left_title">' . $txt['pmx_edit_content'] . '</span></h4> </div> <textarea name="' . $context['pmx']['script']['id'] . '" id="' . $context['pmx']['script']['id'] . '" style="display:block;width:' . $context['pmx']['script']['width'] . ';height:' . $context['pmx']['script']['height'] . ';">' . $context['pmx']['script']['value'] . '</textarea>'; } echo ' </td> </tr> <tr> <td style="padding:4px;"> <div style="min-height:182px;"> <input type="hidden" name="config[settings]" value="" />'; // show the settings area echo ' <div class="cat_bar catbg_grid grid_padd"> <h4 class="catbg catbg_grid"><span class="cat_left_title">' . $txt['pmx_articles_types'][$this->cfg['ctype']] . ' ' . $txt['pmx_article_settings_title'] . '</span></h4> </div> <div>'; if ($this->cfg['ctype'] == 'html') { echo ' <div class="adm_check"> <span class="adm_w80">' . $txt['pmx_html_teaser'] . ' <img class="info_toggle" onclick=\'Show_help("pmxHTMLH01")\' src="' . $context['pmx_imageurl'] . 'information.png" alt="*" title="' . $txt['pmx_information_icon'] . '" /> </span> <input type="hidden" name="config[settings][teaser]" value="0" /> <div><input class="input_check" type="checkbox" name="config[settings][teaser]" value="1"' . (isset($this->cfg['config']['settings']['teaser']) && !empty($this->cfg['config']['settings']['teaser']) ? ' checked="checked"' : '') . ' /></div> </div> <div id="pmxHTMLH01" class="info_frame" style="margin-top:4px;">' . str_replace('@@', '<img src="' . $context['pmx_imageurl'] . 'pgbreak.png" alt="*" style="vertical-align:-5px;"/>', $txt['pmx_html_teasehelp']) . '</div>'; } elseif ($this->cfg['ctype'] != 'php') { echo ' <div class="adm_check"> <span class="adm_w80">' . sprintf($txt['pmx_article_teaser'], $txt['pmx_teasemode'][intval(!empty($context['pmx']['settings']['teasermode']))]) . ' <img class="info_toggle" onclick=\'Show_help("pmxHTMLH02")\' src="' . $context['pmx_imageurl'] . 'information.png" alt="*" title="' . $txt['pmx_information_icon'] . '" /> </span> <div><input type="text" size="5" name="config[settings][teaser]" value="' . (isset($this->cfg['config']['settings']['teaser']) ? $this->cfg['config']['settings']['teaser'] : '') . '" /></div> </div> <div id="pmxHTMLH02" class="info_frame" style="margin-top:4px;">' . $txt['pmx_article_teasehelp'] . '</div>'; } echo ' <div class="adm_check"> <span class="adm_w80">' . $txt['pmx_content_print'] . '</span> <input type="hidden" name="config[settings][printing]" value="0" /> <div><input class="input_check" type="checkbox" name="config[settings][printing]" value="1"' . (!empty($this->cfg['config']['settings']['printing']) ? ' checked="checked"' : '') . ' /></div> </div> <div class="adm_check"> <span class="adm_w80">' . $txt['pmx_article_footer'] . ' <img class="info_toggle" onclick=\'Show_help("pmxARTH01")\' src="' . $context['pmx_imageurl'] . 'information.png" alt="*" title="' . $txt['pmx_information_icon'] . '" /> </span> <input type="hidden" name="config[settings][showfooter]" value="0" /> <div><input class="input_check" type="checkbox" name="config[settings][showfooter]" value="1"' . (isset($this->cfg['config']['settings']['showfooter']) && !empty($this->cfg['config']['settings']['showfooter']) ? ' checked="checked"' : '') . ' /></div> </div> <div id="pmxARTH01" class="info_frame" style="margin-top:4px;">' . $txt['pmx_article_footerhelp'] . '</div> <input type="hidden" name="config[show_sitemap]" value="0" />'; if ($this->cfg['ctype'] != 'php') { echo ' <div class="adm_check"> <span class="adm_w80">' . $txt['pmx_articles_disableHSimage'] . '</span> <input type="hidden" name="config[settings][disableHSimg]" value="0" /> <div><input class="input_check" type="checkbox" name="config[settings][disableHSimg]" value="1"' . (isset($this->cfg['config']['settings']['disableHSimg']) && !empty($this->cfg['config']['settings']['disableHSimg']) ? ' checked="checked"' : '') . (!empty($context['pmx']['settings']['disableHS']) ? ' disabled="disabled"' : '') . ' /></div> </div>'; } echo ' </div> </div>'; // the group access echo ' <div class="cat_bar catbg_grid grid_padd grid_top"> <h4 class="catbg catbg_grid"> <img class="grid_click_image pmxleft" onclick=\'Show_help("pmxBH03")\' src="' . $context['pmx_imageurl'] . 'information.png" alt="*" title="' . $txt['pmx_information_icon'] . '" /> <span class="cat_msg_title">' . $txt['pmx_article_groups'] . '</span> </h4> </div> <select id="pmxgroups" onchange="changed(\'pmxgroups\');" style="width:83%;" name="acsgrp[]" multiple="multiple" size="5">'; if (!empty($this->cfg['acsgrp'])) { list($grpacs, $denyacs) = Pmx_StrToArray($this->cfg['acsgrp'], ',', '='); } else { $grpacs = $denyacs = array(); } foreach ($this->smf_groups as $grp) { echo ' <option value="' . $grp['id'] . '=' . intval(!in_array($grp['id'], $denyacs)) . '"' . (in_array($grp['id'], $grpacs) ? ' selected="selected"' : '') . '>' . (in_array($grp['id'], $denyacs) ? '^' : '') . $grp['name'] . '</option>'; } echo ' </select> <div id="pmxBH03" class="info_frame">' . $txt['pmx_article_groupshelp'] . '</div> <script type="text/javascript"> var pmxgroups = new MultiSelect("pmxgroups"); </script>'; // article moderate if (!isset($this->cfg['config']['can_moderate'])) { $this->cfg['config']['can_moderate'] = 1; } if (allowPmx('pmx_articles, pmx_create', true)) { echo ' <input type="hidden" name="config[can_moderate]" value="' . $this->cfg['config']['can_moderate'] . '" />'; } if (allowPmx('pmx_admin, pmx_articles, pmx_create')) { echo ' <div class="cat_bar catbg_grid grid_padd grid_top"> <h4 class="catbg catbg_grid"> <span class="cat_msg_title">' . $txt['pmx_article_moderate_title'] . '</span> </h4> </div>'; } if (allowPmx('pmx_admin')) { echo ' <div class="adm_check"> <span class="adm_w80">' . $txt['pmx_article_moderate'] . ' </span> <input type="hidden" name="config[can_moderate]" value="0" /> <div><input class="input_check" type="checkbox" name="config[can_moderate]" value="1"' . (!empty($this->cfg['config']['can_moderate']) ? ' checked="checked"' : '') . ' /></div> </div>'; } echo ' <input type="hidden" name="config[check_ecl]" value="0" /> <input type="hidden" name="config[check_eclbots]" value="0" />'; if (allowPmx('pmx_admin, pmx_articles, pmx_create') && !empty($modSettings['pmx_ecl'])) { echo ' <div class="adm_check"> <span class="adm_w80">' . $txt['pmx_check_artelcmode'] . ' <img class="info_toggle" onclick=\'Show_help("pmxArteclHelp")\' src="' . $context['pmx_imageurl'] . 'information.png" alt="*" title="' . $txt['pmx_information_icon'] . '" /> </span> <div><input class="input_check" type="checkbox" name="config[check_ecl]" value="1"' . (!empty($this->cfg['config']['check_ecl']) ? ' checked="checked"' : '') . ' onclick="showeclbots(this)" /></div> </div> <div id="pmxArteclHelp" class="info_frame" style="margin-top:0px;">' . $txt['pmx_art_eclcheckhelp'] . '</div> <div id="eclextend" style="display:' . (!empty($this->cfg['config']['check_ecl']) ? 'block' : 'none') . '"> <div class="adm_check"> <span class="adm_w80">' . $txt['pmx_check_artelcbots'] . ' <img class="info_toggle" onclick=\'Show_help("pmxeclHelpbots")\' src="' . $context['pmx_imageurl'] . 'information.png" alt="*" title="' . $txt['pmx_information_icon'] . '" /> </span> <div><input id="eclextendinp" class="input_check" type="checkbox" name="config[check_eclbots]" value="1"' . (!empty($this->cfg['config']['check_eclbots']) ? ' checked="checked"' : '') . ' /></div> </div> <div id="pmxeclHelpbots" class="info_frame" style="margin-top:0;">' . $txt['pmx_art_eclcheckbotshelp'] . '</div> <script type="text/javascript"> function showeclbots(elm) {if(elm.checked == true) document.getElementById("eclextend").style.display = "block"; else {document.getElementById("eclextend").style.display = "none"; document.getElementById("eclextendinp").checked = false;}} </script> </td>'; } // the visual options echo ' <td id="set_col" style="padding:4px;"> <div class="cat_bar catbg_grid grid_padd"> <h4 class="catbg catbg_grid"><span class="cat_left_title">' . $txt['pmx_edit_visuals'] . '</span></h4> </div> <div style="float:left; height:30px; width:177px;">' . $txt['pmx_edit_cancollapse'] . '</div> <input style="padding-left:141px;" type="hidden" name="config[collapse]" value="0" /> <input class="input_check" id="collapse" type="checkbox" name="config[collapse]" value="1"' . ($this->cfg['config']['visuals']['header'] == 'none' ? ' disabled="disabled"' : ($this->cfg['config']['collapse'] == 1 ? ' checked="checked"' : '')) . ' /> <div style="clear:both;" /></div> <div style="float:left; height:30px; width:180px;">' . $txt['pmx_edit_collapse_state'] . '</div> <select style="width:46%;" size="1" name="config[collapse_state]">'; foreach ($txt['pmx_collapse_mode'] as $key => $text) { echo ' <option value="' . $key . '"' . (isset($this->cfg['config']['collapse_state']) && $this->cfg['config']['collapse_state'] == $key ? ' selected="selected"' : '') . '>' . $text . '</option>'; } echo ' </select> <br style="clear:both;" /> <div style="float:left; height:30px; width:180px;">' . $txt['pmx_edit_overflow'] . '</div> <select style="width:46%;" size="1" id="mxhgt" name="config[overflow]" onchange="checkMaxHeight(this);">'; foreach ($txt['pmx_overflow_actions'] as $key => $text) { echo ' <option value="' . $key . '"' . (isset($this->cfg['config']['overflow']) && $this->cfg['config']['overflow'] == $key ? ' selected="selected"' : '') . '>' . $text . '</option>'; } echo ' </select> <br style="clear:both;" /> <div style="float:left; min-height:30px; width:99%;"> <div style="float:left; min-height:30px; width:180px;">' . $txt['pmx_edit_height'] . '</div> <div style="float:left; width:46%"> <input onkeyup="check_numeric(this)" id="maxheight" type="text" size="4" name="config[maxheight]" value="' . (isset($this->cfg['config']['maxheight']) ? $this->cfg['config']['maxheight'] : '') . '"' . (!isset($this->cfg['config']['overflow']) || empty($this->cfg['config']['overflow']) ? ' disabled="disabled"' : '') . ' /><span class="smalltext">' . $txt['pmx_pixel'] . '</span><span style="display:inline-block; width:3px;"></span> <select id="maxheight_sel" style="float:right;width:52%;margin-right:-1%;" size="1" name="config[height]">'; foreach ($txt['pmx_edit_height_mode'] as $key => $text) { echo ' <option value="' . $key . '"' . (isset($this->cfg['config']['height']) && $this->cfg['config']['height'] == $key ? ' selected="selected"' : '') . '>' . $text . '</option>'; } echo ' </select> </div> </div> <br style="clear:both;" /> <script type="text/javascript"> checkMaxHeight(document.getElementById("mxhgt")); </script> <div style="float:left; height:30px; width:180px;">' . $txt['pmx_edit_innerpad'] . '</div> <input onkeyup="check_numeric(this, \',\')" type="text" size="4" name="config[innerpad]" value="' . (isset($this->cfg['config']['innerpad']) ? $this->cfg['config']['innerpad'] : '4') . '" /><span class="smalltext">' . $txt['pmx_pixel'] . ' (xy/y,x)</span> <br style="clear:both;" />'; // CSS class settings echo ' <div class="cat_bar catbg_grid grid_padd"> <h4 class="catbg catbg_grid grid_botpad"> <div style="float:left; width:177px;"><span class="cat_left_title">' . $txt['pmx_edit_usedclass_type'] . '</span></div> <span class="cat_left_title">' . $txt['pmx_edit_usedclass_style'] . '</span> </h4> </div> <div style="margin:0px 2px;">'; // write out the classes foreach ($this->usedClass as $ucltyp => $ucldata) { echo ' <div style="float:left; width:180px; height:30px; padding-top:2px;">' . $ucltyp . '</div> <select' . ($ucltyp == 'frame' || $ucltyp == 'postframe' ? ' id="pmx_' . $ucltyp . '" ' : ' ') . 'style="width:46%;" name="config[visuals][' . $ucltyp . ']" onchange="checkCollapse(this)">'; foreach ($ucldata as $cname => $class) { echo ' <option value="' . $class . '"' . (!empty($this->cfg['config']['visuals'][$ucltyp]) ? $this->cfg['config']['visuals'][$ucltyp] == $class ? ' selected="selected"' : '' : (substr($cname, 0, 1) == '+' ? ' selected="selected"' : '')) . '>' . substr($cname, 1) . '</option>'; } echo ' </select> <br style="clear:both;" />'; } echo ' </div> <div class="cat_bar catbg_grid grid_padd" style="margin-top:-2px;"> <h4 class="catbg catbg_grid"><span class="cat_left_title" style="margin-left:-3px;">' . $txt['pmx_edit_canhavecssfile'] . '</span></h4> </div> <div style="float:left; margin:0px 2px; width:176px;">' . $txt['pmx_edit_cssfilename'] . '</div> <select id="sel.css.file" style="width:46%;margin-bottom:2px;" name="config[cssfile]" onchange="pmxChangeCSS(this)"> <option value=""></option>'; // custon css files exist ? if (!empty($this->custom_css)) { // write out custom mpt/css definitions foreach ($this->custom_css as $custcss) { if (is_array($custcss)) { echo ' <option value="' . $custcss['file'] . '"' . ($this->cfg['config']['cssfile'] == $custcss['file'] ? ' selected="selected"' : '') . '>' . $custcss['file'] . '</option>'; } } echo ' </select> <div style="clear:both; height:2px;"></div>'; // write out all class definitions (hidden) foreach ($this->custom_css as $custcss) { if (is_array($custcss)) { echo ' <div id="' . $custcss['file'] . '" style="display:none;">'; foreach ($custcss['class'] as $key => $val) { if (in_array($key, array_keys($this->usedClass))) { echo ' <div style="float:left; width:180px; padding:0 2px;">' . $key . '</div>' . (empty($val) ? sprintf($txt['pmx_edit_nocss_class'], $settings['theme_id']) : $val) . '<br />'; } } echo ' </div>'; } } echo ' <script type="text/javascript"> var elm = document.getElementById("sel.css.file"); var fname = elm.options[elm.selectedIndex].value; if(document.getElementById(fname)) document.getElementById(fname).style.display = ""; function pmxChangeCSS(elm) { for(i=0; i<elm.length; i++) { if(document.getElementById(elm.options[i].value)) document.getElementById(elm.options[i].value).style.display = "none"; } var fname = elm.options[elm.selectedIndex].value; if(document.getElementById(fname)) document.getElementById(fname).style.display = ""; } </script>'; } else { echo ' </select> <div style="clear:both; height:6px;"></div>'; } echo ' </td> </tr> <tr> <td colspan="2" style="text-align:center;padding:4px 4px 0 4px;"><hr class="pmx_hr" /> <div style="height:10px;"></div> <input class="button_submit" type="button" style="margin-right:10px;" value="' . $txt['pmx_save_exit'] . '" onclick="FormFuncCheck(\'save_edit\', \'1\')" /> <input class="button_submit" type="button" style="margin-right:10px;" value="' . $txt['pmx_save_cont'] . '" onclick="FormFuncCheck(\'save_edit_continue\', \'1\')" /> <input class="button_submit" type="button" style="margin-right:10px;" value="' . $txt['pmx_cancel'] . '" onclick="FormFunc(\'cancel_edit\', \'1\')" /> </td> </tr> </table> </div> </td> </tr>'; }
/** * The main Subtemplate. */ function template_main() { global $context, $txt, $scripturl; global $cfg_titleicons, $cfg_smfgroups; $curarea = isset($_GET['area']) ? $_GET['area'] : 'pmx_center'; if (allowPmx('pmx_admin', true)) { $AdmTabs = array('pmx_center' => $txt['pmx_admincenter'], 'pmx_settings' => $txt['pmx_settings'], 'pmx_blocks' => $txt['pmx_blocks'], 'pmx_categories' => $txt['pmx_categories'], 'pmx_articles' => $txt['pmx_articles'], 'pmx_sefengine' => $txt['pmx_sefengine']); echo ' <div style="height:3em;margin-top:5px;"> <ul id="pmxmenu_nav" class="dropmenu sf-js-enabled">'; foreach ($AdmTabs as $name => $desc) { echo ' <li id="' . $name . '" class="subsections"> <a ' . ($name == $curarea ? 'class="active"' : '') . 'href="' . $scripturl . '?action=portamx;area=' . $name . ';' . $context['session_var'] . '=' . $context['session_id'] . '">' . $desc . '</a> </li>'; } echo ' </ul> </div>'; } echo ' <div class="cat_bar"> <h3 class="catbg">' . $txt['pmx_adm_categories'] . '</h3> </div> <p class="information" style="margin: 0;padding: 8px;">' . $txt['pmx_categories_desc'] . '</p> <div style="height:0.5em;"></div> <form id="pmx_form" accept-charset="', $context['character_set'], '" name="PMxAdminCategories" action="' . $scripturl . '?action=' . $context['pmx']['AdminMode'] . ';area=pmx_categories;' . $context['session_var'] . '=' . $context['session_id'] . '" method="post" style="margin-bottom: 4px;"> <input type="hidden" name="sc" value="', $context['session_id'], '" /> <input type="hidden" name="sa" value="', $context['pmx']['subaction'], '" /> <input id="common_field" type="hidden" value="" /> <input id="extra_cmd" type="hidden" value="" />'; // ------------------------ // all categories overview // ------------------------ if ($context['pmx']['subaction'] == 'overview') { $cfg_titleicons = PortaMx_getAllTitleIcons(); $cfg_smfgroups = PortaMx_getUserGroups(); $allNames = array(); $allGroups = array(); foreach ($cfg_smfgroups as $key => $grp) { $allGroups[] = $grp['id']; $allNames[] = str_replace(' ', '_', $grp['name']); } $categoryCnt = 0; $catIDs = array(); // common Popup input fields echo ' <input id="pWind.language.cat" type="hidden" value="' . $context['pmx']['currlang'] . '" /> <input id="pWind.icon.url" type="hidden" value="' . $context['pmx_Iconsurl'] . '" /> <input id="pWind.image.url" type="hidden" value="' . $context['pmx_imageurl'] . '" /> <input id="pWind.name" type="hidden" value="" /> <input id="pWind.id" type="hidden" value="" /> <input id="pWind.side" type="hidden" value="" /> <input id="allAcsGroups" type="hidden" value="' . implode(',', $allGroups) . '" /> <input id="allAcsNames" type="hidden" value="' . implode(',', $allNames) . '" /> <div id="addnodes" style="display:none"></div>'; echo ' <div class="cat_bar catbg_grid"> <h4 class="catbg catbg_grid"> <span class="pmx_clickaddnew" title="' . $txt['pmx_categories_add'] . '" onclick="FormFunc(\'add_new_category\', \'1\')"></span> <span class="cat_msg_title_center">' . $txt['pmx_categories_overview'] . '</span> </h4> </div> <div class="windowbg2 wdbgtop" style="margin-bottom:4px;"> <div class="pmx_tbl" style="margin-bottom:3px;"> <div class="pmx_tbl_tr windowbg2 normaltext" style="height:27px;"> <div class="pmx_tbl_tdgrid" style="width:45px;"><b>' . $txt['pmx_categories_order'] . '</b></div> <div class="pmx_tbl_tdgrid" style="width:57%;cursor:pointer;" onclick="pWindToggleLang(\'cat\')" title="' . $txt['pmx_toggle_language'] . '"><b>' . $txt['pmx_title'] . ' [<b id="pWind.def.lang.cat">' . $context['pmx']['currlang'] . '</b>]</b></div> <div class="pmx_tbl_tdgrid" style="width:34%;"><b>' . $txt['pmx_categories_name'] . '</b></div> <div class="pmx_tbl_tdgrid" style="width:84px;"><b>' . $txt['pmx_options'] . '</b></div> <div class="pmx_tbl_tdgrid" style="width:84px;"><b>' . $txt['pmx_functions'] . '</b></div> </div>'; // call PmxCategoryOverview for each category foreach ($context['pmx']['catorder'] as $catorder) { $cat = PortaMx_getCatByOrder($context['pmx']['categories'], $catorder); PmxCategoryOverview($cat); $catIDs[] = $cat['id']; } echo ' </div> <input id="pWind.all.ids.cat" type="hidden" value="' . implode(',', $catIDs) . '" /> </div>'; /** * Popup windows for overview **/ echo ' <div style="padding:0;margin:-10px 6px 0 6px"> <table class="pmx_table_grid" style="border-color:transparent;table-layout:fixed;"> <tr id="popupRow"> <td class="tdnogrid" style="width:46px;">'; // start Move popup echo ' <div id="pmxSetMove" class="smalltext" style="width:344px;z-index:9999;margin-top:-34px;display:none;"> ' . pmx_popupHeader('pmxSetMove', $txt['pmx_categories_movecat']) . ' <input id="pWind.move.error" type="hidden" value="' . $txt['pmx_categories_move_error'] . '" /> <div style="float:left;width:130px;">' . $txt['pmx_categories_move'] . '</div> <div style="margin-left:130px;" id="pWind.move.catname"> </div> <div style="float:left;width:126px;">' . $txt['pmx_categories_moveplace'] . '</div> <div style="margin-left:126px;">'; $opt = 0; foreach ($txt['pmx_categories_places'] as $artType => $artDesc) { echo ' <input id="pWind.place.' . $opt . '" class="input_check" type="radio" name="_" value="' . $artType . '"' . ($artType == 'after' ? ' checked="checked"' : '') . ' /><span style="vertical-align:3px; padding:0 3px;">' . $artDesc . '</span>' . ($opt == 1 ? '<br />' : ''); $opt++; } // all exist categories echo ' </div> <div style="float:left; width:130px;margin-top:4px;">' . $txt['pmx_categories_tomovecat'] . '</div> <div style="margin-left:130px;margin-top:4px;"> <select id="pWind.sel.destcat" style="width:180px;" size="1">'; // output cats foreach ($context['pmx']['catorder'] as $catorder) { $cat = PortaMx_getCatByOrder($context['pmx']['categories'], $catorder); echo ' <option value="' . $cat['id'] . '">[' . $catorder . ']' . str_repeat('•', $cat['level']) . ' ' . $cat['name'] . '</option>'; } echo ' </select> </div> <div style="text-align:right; margin-top:8px;height:20px;"> <input class="button_submit" type="button" value="' . $txt['pmx_save'] . '" onclick="pmxSaveMove()" /> </div> </div> </div>'; // end Move popup echo ' </td> <td class="tdnogrid" style="width:57%;">'; // start title edit popup echo ' <div id="pmxSetTitle" class="smalltext" style="width:420px;z-index:9999;display:none;margin-top:-34px;"> ' . pmx_popupHeader('pmxSetTitle', $txt['pmx_edit_titles'], '112px') . ' <div style="float:left; width:75px;">' . $txt['pmx_edit_title'] . '</div> <input id="pWind.text" style="width:310px;" type="text" value="" /> <input id="pWindID" type="hidden" value="" /> <div style="clear:both; height:10px;"> <img style="float:left;margin-top:-3px;" src="' . $context['pmx_imageurl'] . 'arrow_down.gif" alt="*" title="" /> </div> <div style="float:left; width:75px;">' . $txt['pmx_edit_title_lang'] . '</div> <select id="pWind.lang.sel" style="float:left; width:165px;" size="1" onchange="pmxChgTitles_Lang(this)">'; // languages foreach ($context['pmx']['languages'] as $lang => $sel) { echo ' <option value="' . $lang . '">' . $lang . '</option>'; } echo ' </select> <div style="float:right;padding-right:1px;"><span style="vertical-align:6px;">' . $txt['pmx_edit_title_align'] . '</span>'; // Title align foreach ($txt['pmx_edit_title_align_types'] as $key => $val) { echo ' <img id="pWind.align.' . $key . '" src="' . $context['pmx_imageurl'] . 'text_align_' . $key . '.gif" alt="*" title="' . $txt['pmx_edit_title_helpalign'] . $val . '" style="vertical-align:2px; cursor:pointer;" onclick="pmxChgTitles_Align(\'' . $key . '\')" />'; } echo ' </div> <br style="clear:both;" /> <input style="float:right; margin-top:9px;margin-right:1px;" class="button_submit" type="button" value="' . $txt['pmx_update_save'] . '" onclick="pmxUpdateTitles()" /> <div style="float:left;width:75px; padding-top:8px;">' . $txt['pmx_edit_titleicon'] . '</div>'; // Title icons echo ' <div class="ttliconDiv" onclick="setNewIcon(document.getElementById(\'pWind.icon_sel\'), event)"> <input id="post_image" type="hidden" name="config[title_icon]" value="" /> <input id="iconDD" value="' . (isset($category['config']['title_icon']) ? ucfirst(str_replace('.png', '', $category['config']['title_icon'])) : 'None') . '" readonly /> <img id="pWind.icon" class="pwindicon" src="' . $context['pmx_shortIconsurl'] . 'none.png" alt="*" /> <img class="ddImage" src="' . $context['pmx_imageurl'] . 'state_expanded.png" alt="*" title="" /> </div> <ul class="ttlicondd" id="pWind.icon_sel" onclick="updIcon(this)">'; foreach ($cfg_titleicons as $file => $name) { echo ' <li id="' . $file . '" class="ttlicon' . (isset($category['config']['title_icon']) && $category['config']['title_icon'] == $file ? ' active' : '') . '"> <img src="' . $context['pmx_shortIconsurl'] . $file . '" alt="*" /><span>' . $name . '</span> </li>'; } echo ' </ul> <script>$("li").hover(function(){$(this).toggleClass("active")});</script> </div> </div>'; // end title edit popup echo ' </td> <td class="tdnogrid" style="width:34%;">'; // Categorie name popup echo ' <div id="pmxSetCatName" class="smalltext" style="width:280px;z-index:9999;margin-top:-34px;display:none;"> ' . pmx_popupHeader('pmxSetCatName', $txt['pmx_categories_setname']) . ' <div style="float:left;width:140px; height:25px;">' . $txt['pmx_categories_name'] . ': <img class="info_toggle" onclick=\'Show_help("pmxBH11")\' src="' . $context['pmx_imageurl'] . 'information.png" alt="*" title="' . $txt['pmx_information_icon'] . '" /> </div> <span id="check.name.error" style="display:none;">' . sprintf($txt['namefielderror'], $txt['pmx_categories_name']) . '</span> <div style="height:25px;"> <input id="check.name" style="width:160px;" onkeyup="check_requestname(this)" onkeypress="check_requestname(this)" type="text" value="" /> </div> <div id="pmxBH11" class="info_frame" style="margin-top:25px;">' . $txt['pmx_edit_pagenamehelp'] . ' </div> <div style="text-align:right; height:20px;"> <input class="button_submit" type="button" value="' . $txt['pmx_update_save'] . '" onclick="pmxUpdateCatName()" /> </div> </div> </div>'; // end Categorie name popup echo ' </td> <td class="tdnogrid" style="width:84px;">'; // start articles in cat popup echo ' <div id="pmxShowArt" class="smalltext" style="width:250px;z-index:9999;margin-top:-34px;display:none;"> ' . pmx_popupHeader('pmxShowArt', $txt['pmx_categories_showarts']) . ' <div id="artsorttxt" style="margin-top:-5px;"></div> <div id="artsort" class="smalltext" style="max-height: 30px; overflow:auto;"></div><hr class="pmx_hr" /> <div id="showarts" style="max-height: 170px; overflow:auto;"></div> </div> </div>'; // start articles in cat popup echo ' </td> <td class="tdnogrid" style="width:83px;">'; // start Access popup echo ' <div id="pmxSetAcs" class="smalltext" style="width:210px;z-index:9999;display:none;margin-top:-34px;"> ' . pmx_popupHeader('pmxSetAcs', $txt['pmx_article_groups']) . ' <div style="height:15px;margin-top:-5px;"> <input id="pWindAcsModeupd" onclick="pmxSetAcsMode(\'upd\')" class="input_check" type="radio" name="_" value="" /><span style="vertical-align:3px; padding:0 3px;">' . $txt['pmx_acs_repl'] . '</span> </div> <div style="height:15px;"> <input id="pWindAcsModeadd" onclick="pmxSetAcsMode(\'add\')" class="input_check" type="radio" name="_" value="" /><span style="vertical-align:3px; padding:0 3px;">' . $txt['pmx_acs_add'] . '</span> </div> <div style="height:15px;margin-bottom:10px;"> <input id="pWindAcsModedel" onclick="pmxSetAcsMode(\'del\')" class="input_check" type="radio" name="_" value="" /><span style="vertical-align:3px; padding:0 3px;">' . $txt['pmx_acs_rem'] . '</span> </div> <select id="pWindAcsGroup" style="width:100%;" multiple="multiple" size="6" onchange="changed(\'pWindAcsGroup\');">'; foreach ($cfg_smfgroups as $grp) { echo ' <option value="' . $grp['id'] . '=1">' . $grp['name'] . '</option>'; } echo ' </select><br /> <script type="text/javascript"> var pWindAcsGroup = new MultiSelect("pWindAcsGroup"); </script> <div style="text-align:right; margin-top:7px;"> <input class="button_submit" type="button" value="' . $txt['pmx_update_save'] . '" onclick="pmxUpdateAcs()" /> <input id="acs_all_button" class="button_submit" type="button" value="' . $txt['pmx_update_all'] . '" onclick="pmxUpdateAcs(\'all\')" /> </div> </div> </div>'; // end Access popup // start Clone popup echo ' <div id="pmxSetCatClone" class="smalltext" style="width:220px;margin-top:-34px;z-index:9999;display:none;"> ' . pmx_popupHeader('pmxSetCatClone', $txt['pmx_cat_clone']) . ' <div>' . $txt['pmx_confirm_catclone'] . '</div> <input id="pWind.catcloneid" type="hidden" value="" /> <input style="float:right;font-size:11px;font-weight:bold;margin-top:5px" class="button_submit" type="button" value="' . $txt['pmx_delete_button'] . '" onclick="pmxSendCatClone()" /> <div style="height:25px;"></div> </div> </div>'; // end Clone popup // start delete popup echo ' <div id="pmxSetCatDelete" class="smalltext" style="width:220px;;margin-top:-34px;z-index:9999;display:none;"> ' . pmx_popupHeader('pmxSetCatDelete', $txt['pmx_cat_delete']) . ' <div>' . $txt['pmx_confirm_catdelete'] . '</div> <input id="pWind.catdelid" type="hidden" value="" /> <input style="float:right;font-size:11px;font-weight:bold;margin-top:5px;" class="button_submit" type="button" value="' . $txt['pmx_delete_button'] . '" onclick="pmxSendCatDelete()" /> <div style="height:25px;"></div> </div> </div>'; // end delete popup echo ' </td> </tr> </table> </div>'; } elseif ($context['pmx']['subaction'] == 'edit' || $context['pmx']['subaction'] == 'editnew') { echo ' <table class="pmx_table" style="margin-bottom:5px;table-layout:fixed;"> <tr> <td style="text-align:center"> <div class="cat_bar" style="border-bottom-left-radius:6px;border-bottom-right-radius:6px"> <h3 class="catbg"> ' . $txt['pmx_categories_edit'] . ' </h3> </div> </td> </tr>'; // call the ShowAdmCategoryConfig() methode $context['pmx']['editcategory']->pmxc_ShowAdmCategoryConfig(); echo ' </table>'; } echo ' </form>'; }
/** * The main Subtemplate. */ function template_main() { global $context, $txt, $scripturl; $curarea = isset($_GET['area']) ? $_GET['area'] : 'pmx_center'; if (allowPmx('pmx_admin', true)) { $AdmTabs = array('pmx_center' => $txt['pmx_admincenter'], 'pmx_settings' => $txt['pmx_settings'], 'pmx_blocks' => $txt['pmx_blocks'], 'pmx_categories' => $txt['pmx_categories'], 'pmx_articles' => $txt['pmx_articles'], 'pmx_sefengine' => $txt['pmx_sefengine']); echo ' <div style="height:2.8em;margin-top:5px;"> <ul id="pmxmenu_nav" class="dropmenu sf-js-enabled">'; foreach ($AdmTabs as $name => $desc) { echo ' <li id="' . $name . '" class="subsections"> <a ' . ($name == $curarea ? 'class="active"' : '') . 'href="' . $scripturl . '?action=portamx;area=' . $name . ';' . $context['session_var'] . '=' . $context['session_id'] . '">' . $desc . '</a> </li>'; } echo ' </ul> </div>'; } if (!isset($context['pmx']['articlestart'])) { $context['pmx']['articlestart'] = 0; } echo ' <div class="cat_bar"><h3 class="catbg">' . $txt['pmx_adm_articles'] . '</h3></div> <p class="information" style="margin: 0;padding: 8px;">' . $txt['pmx_articles_desc'] . '</p> <div style="height:0.5em;"></div>'; if ($context['pmx']['subaction'] == 'overview') { // create the pageindex $cururl = !empty($_GET) ? pmx_http_build_query($_GET, '', ';') . ';' : ''; $pageindex = constructPageIndex($scripturl . '?' . $cururl . 'pg=%1$d', $context['pmx']['articlestart'], $context['pmx']['totalarticles'], $context['pmx']['settings']['manager']['artpage'], true); $pageindex = str_replace(';start=%1$d', '', $pageindex); } echo ' <form id="pmx_form" accept-charset="' . $context['character_set'] . '" name="PMxAdminArticles" action="' . $scripturl . '?action=' . $context['pmx']['AdminMode'] . ';area=pmx_articles;' . $context['session_var'] . '=' . $context['session_id'] . '" method="post" style="margin: 0px;" onsubmit="submitonce(this);"> <input type="hidden" name="sc" value="' . $context['session_id'] . '" /> <input type="hidden" name="sa" value="' . $context['pmx']['subaction'] . '" /> <input type="hidden" name="articlestart" value="' . $context['pmx']['articlestart'] . '" /> <input type="hidden" name="fromblock" value="' . (!empty($context['pmx']['fromblock']) ? $context['pmx']['fromblock'] : '') . '" /> <input type="hidden" id="pWind.all.cats" value="' . pmx_getAllCatID() . '" /> <input id="common_field" type="hidden" value="" /> <input id="extra_cmd" type="hidden" value="" /> <script> var Art = []; Art["active"] = "' . $txt['pmx_status_activ'] . ' - ' . $txt['pmx_status_change'] . '"; Art["notactive"] = "' . $txt['pmx_status_inactiv'] . ' - ' . $txt['pmx_status_change'] . '"; Art["approved"] = "' . $txt['pmx_article_approved'] . ' - ' . $txt['pmx_status_change'] . '"; Art["notapproved"] = "' . $txt['pmx_article_not_approved'] . ' - ' . $txt['pmx_status_change'] . '"; </script>'; // --------------------- // all articles overview // --------------------- if ($context['pmx']['subaction'] == 'overview') { $cfg_titleicons = PortaMx_getAllTitleIcons(); $cfg_smfgroups = PortaMx_getUserGroups(); $categories = PortaMx_getCategories(); $allNames = array(); $allGroups = array(); foreach ($cfg_smfgroups as $key => $grp) { $allGroups[] = $grp['id']; $allNames[] = str_replace(' ', '_', $grp['name']); } // common Popup input fields echo ' <input id="pWind.language." type="hidden" value="' . $context['pmx']['currlang'] . '" /> <input id="pWind.icon.url" type="hidden" value="' . $context['pmx_Iconsurl'] . '" /> <input id="pWind.image.url" type="hidden" value="' . $context['pmx_imageurl'] . '" /> <input id="pWind.name" type="hidden" value="" /> <input id="pWind.id" type="hidden" value="" /> <input id="pWind.catsel" type="hidden" value="" /> <input id="pWind.side" type="hidden" value="" /> <input id="set.filter.category" type="hidden" name="filter[category]" value="' . $_SESSION['PortaMx']['filter']['category'] . '" /> <input id="set.filter.approved" type="hidden" name="filter[approved]" value="' . $_SESSION['PortaMx']['filter']['approved'] . '" /> <input id="set.filter.active" type="hidden" name="filter[active]" value="' . $_SESSION['PortaMx']['filter']['active'] . '" /> <input id="set.filter.myown" type="hidden" name="filter[myown]" value="' . $_SESSION['PortaMx']['filter']['myown'] . '" /> <input id="set.filter.member" type="hidden" name="filter[member]" value="' . $_SESSION['PortaMx']['filter']['member'] . '" /> <input id="allAcsGroups" type="hidden" value="' . implode(',', $allGroups) . '" /> <input id="allAcsNames" type="hidden" value="' . implode(',', $allNames) . '" /> <div id="addnodes" style="display:none"></div>'; $filterActive = $_SESSION['PortaMx']['filter']['category'] != '' || $_SESSION['PortaMx']['filter']['approved'] != 0 || $_SESSION['PortaMx']['filter']['active'] != 0 || $_SESSION['PortaMx']['filter']['myown'] != 0 || $_SESSION['PortaMx']['filter']['member'] != ''; // top pageindex echo ' <div class="smalltext pmx_pgidx_top">' . $pageindex . '</div>'; echo ' <div style="margin-bottom:-10px;"> <div class="cat_bar catbg_grid"> <h4 class="catbg catbg_grid"> <span' . (allowPmx('pmx_create, pmx_articles, pmx_admin') ? ' class="pmx_clickaddnew" title="' . $txt['pmx_articles_add'] . '" onclick="SetpmxArticleType()"' : '') . '></span> <span class="cat_msg_title_center">' . $txt['pmx_articles_overview'] . '</span> </h4> </div> <div class="windowbg wdbgtop" style="margin-bottom:4px;" id="RowMove-0"> <div class="pmx_tbl" style="margin-bottom:3px;"> <div class="pmx_tbl_tr windowbg2 normaltext" style="height:27px;"> <div class="pmx_tbl_tdgrid" style="width:45px;"><b>' . $txt['pmx_article_order'] . '</b></div> <div class="pmx_tbl_tdgrid" onclick="pWindToggleLang(\'\')" title="' . $txt['pmx_toggle_language'] . '" style="width:48%;cursor:pointer;"><b>' . $txt['pmx_title'] . ' [<b id="pWind.def.lang.">' . $context['pmx']['currlang'] . '</b>]</b></div> <div class="pmx_tbl_tdgrid" style="width:25%;"><b>' . $txt['pmx_articles_type'] . '</b></div> <div class="pmx_tbl_tdgrid" style="width:25%;"><b>' . $txt['pmx_articles_catname'] . '</b> <span class="pmx_' . (empty($filterActive) ? 'nofilter' : 'filter') . '" title="' . $txt['pmx_article_filter'] . '" onclick="pmxSetFilter()"></span> </div> <div class="pmx_tbl_tdgrid" style="width:84px;"><b>' . $txt['pmx_options'] . '</b></div> <div class="pmx_tbl_tdgrid" style="width:45px;"><b>' . $txt['pmx_status'] . '</b></div> <div class="pmx_tbl_tdgrid" style="width:84px;"><b>' . $txt['pmx_functions'] . '</b></div> </div>'; // call PmxArticleOverview for each article $articleCnt = count($context['pmx']['articles']); $artIDs = array(); $pgCount = 0; foreach ($context['pmx']['articles'] as $article) { if ($pgCount >= $context['pmx']['articlestart'] && $pgCount < $context['pmx']['articlestart'] + $context['pmx']['settings']['manager']['artpage']) { PmxArticleOverview($article, $cfg_titleicons, $cfg_smfgroups, $categories); } $pgCount++; $artIDs[] = $article['id']; } echo ' </div> <input id="pWind.all.ids." type="hidden" value="' . implode(',', $artIDs) . '" /> </div> <div style="height:30px"> <div class="smalltext pmx_pgidx_bot">' . $pageindex . '</div> </div> </div>'; /** * Popup windows for overview **/ echo ' <div style="padding:0;margin:-15px 6px 0 6px"> <table class="pmx_table_grid" style="border-color:transparent;table-layout:fixed;"> <tr id="popupRow"> <td class="tdnogrid" style="width:46px;">'; // start row move popup echo ' <div id="pmxRowMove" class="smalltext" style="width:340px;z-index:9999;display:none;left:1px;margin-top:-30px;"> ' . pmx_popupHeader('pmxRowMove', $txt['pmx_rowmove_title']) . ' <input id="pWind.move.error" type="hidden" value="' . $txt['pmx_rowmove_error'] . '" /> <div style="float:left;width:110px;"> ' . $txt['pmx_rowmove'] . ' <div style="margin-top:6px;">' . $txt['pmx_rowmove_place'] . '</div> <div style="margin-top:10px;">' . $txt['pmx_rowmove_to'] . '</div> </div> <div style="padding-left:112px;"> <div style="margin-left:5px; margin-top:2px;" id="pWind.move.pos"></div> <div style="margin-top:5px;"> <input id="pWind.place.0" class="input_radio" type="radio" name="_" value="before" /><span style="padding:0 3px;">' . $txt['pmx_rowmove_before'] . '</span> <input id="pWind.place.1" class="input_radio" type="radio" name="_" value="after" checked="checked" /><span style="padding:0 3px;">' . $txt['pmx_rowmove_after'] . '</span><br /> </div> <select id="pWind.sel" style="width:190px; margin-top:8px; margin-left:5px;" size="1">'; foreach ($context['pmx']['article_rows'] as $id => $data) { echo ' <option value="' . $id . '">[' . $id . '] ' . $data['name'] . ' (' . (empty($data['cat']) ? $txt['pmx_default_none'] : $data['cat']) . ')</option>'; } echo ' </select> </div> <div style="clear:both; text-align:right; margin-top:7px;"> <input class="button_submit" type="button" value="' . $txt['pmx_save'] . '" onclick="pmxSendArtMove()" /> <div style="height:20px;"></div> </div> </div> </div>'; // end Move popup echo ' </td> <td class="tdnogrid" style="width:48%;">'; // start title edit popup echo ' <div id="pmxSetTitle" class="smalltext" style="width:420px;z-index:9999;display:none;margin-top:-30px;"> ' . pmx_popupHeader('pmxSetTitle', $txt['pmx_edit_titles'], '112px') . ' <div style="float:left; width:75px;">' . $txt['pmx_edit_title'] . '</div> <input id="pWind.text" style="width:310px;" type="text" value="" /> <input id="pWindID" type="hidden" value="" /> <div style="clear:both; height:10px;"> <img style="float:left;margin-top:-3px;" src="' . $context['pmx_imageurl'] . 'arrow_down.gif" alt="*" title="" /> </div> <div style="float:left; width:75px;">' . $txt['pmx_edit_title_lang'] . '</div> <select id="pWind.lang.sel" style="float:left; width:165px;" size="1" onchange="pmxChgTitles_Lang(this)">'; // languages foreach ($context['pmx']['languages'] as $lang => $sel) { echo ' <option value="' . $lang . '">' . $lang . '</option>'; } echo ' </select> <div style="float:right;padding-right:1px;"><span style="vertical-align:6px;">' . $txt['pmx_edit_title_align'] . '</span>'; // Title align foreach ($txt['pmx_edit_title_align_types'] as $key => $val) { echo ' <img id="pWind.align.' . $key . '" src="' . $context['pmx_imageurl'] . 'text_align_' . $key . '.gif" alt="*" title="' . $txt['pmx_edit_title_helpalign'] . $val . '" style="vertical-align:2px; cursor:pointer;" onclick="pmxChgTitles_Align(\'' . $key . '\')" />'; } echo ' </div> <br style="clear:both;" /> <input style="float:right; margin-top:9px;margin-right:1px;" class="button_submit" type="button" value="' . $txt['pmx_update_save'] . '" onclick="pmxUpdateTitles()" /> <div style="float:left;width:75px; padding-top:8px;">' . $txt['pmx_edit_titleicon'] . '</div>'; // Title icons echo ' <div class="ttliconDiv" onclick="setNewIcon(document.getElementById(\'pWind.icon_sel\'), event)"> <input id="post_image" type="hidden" name="config[title_icon]" value="" /> <input id="iconDD" value="' . (isset($article['config']['title_icon']) ? ucfirst(str_replace('.png', '', $article['config']['title_icon'])) : 'None') . '" readonly /> <img id="pWind.icon" class="pwindicon" src="' . $context['pmx_shortIconsurl'] . 'none.png" alt="*" /> <img class="ddImage" src="' . $context['pmx_imageurl'] . 'state_expanded.png" alt="*" title="" /> </div> <ul class="ttlicondd" id="pWind.icon_sel" onclick="updIcon(this)">'; foreach ($cfg_titleicons as $file => $name) { echo ' <li id="' . $file . '" class="ttlicon' . (isset($article['config']['title_icon']) && $article['config']['title_icon'] == $file ? ' active' : '') . '"> <img src="' . $context['pmx_shortIconsurl'] . $file . '" alt="*" /><span>' . $name . '</span> </li>'; } echo ' </ul> <script>$("li").hover(function(){$(this).toggleClass("active")});</script> </div> </div>'; // end title edit popup echo ' </td> <td class="tdnogrid" style="width:25%;"></td> <td class="tdnogrid" style="width:25%;">'; // categorie popup echo ' <div id="pmxSetCats" class="smalltext" style="z-index:9999;width:220px;margin-top:-30px;display:none;"> ' . pmx_popupHeader('pmxSetCats', $txt['pmx_category_popup']) . ' <select id="pWind.cats.sel" onchange="pmxChgCats(this)" style="width:100%;" size="6">'; $selcats = array_merge(array(PortaMx_getDefaultCategory($txt['pmx_categories_none'])), $categories); $ordercats = array_merge(array(0), $context['pmx']['catorder']); $isWriter = allowPmx('pmx_create, pmx_articles', true); $isAdm = allowPmx('pmx_admin'); $allcats = array(); foreach ($ordercats as $catorder) { $cat = PortaMx_getCatByOrder($selcats, $catorder); $cfg = unserialize($cat['config']); // allcats html $details = PortaMx_getCatDetails($cat, $categories); $allcats[] = $cat['id'] . '|<div class="' . $details['class'] . '"><b>' . $details['level'] . '</b><span><span class="cat_names">' . $cat['name'] . '</span></span></div>'; if (!empty($isAdm) || !empty($isWriter) && empty($cfg['global'])) { if (empty($cat)) { $cat['id'] = 0; $cat['name'] = $txt['pmx_categories_none']; } $details['parent'] .= $txt['pmx_chg_articlcats']; echo ' <option value="' . $cat['id'] . '">' . str_repeat('•', $cat['level']) . ' ' . $cat['name'] . '</option>'; } } echo ' </select><br /> <div style="text-align:right;margin-top:7px;"> <input class="button_submit" type="button" value="' . $txt['pmx_update_save'] . '" onclick="pmxUpdateCats()" /> <input class="button_submit" type="button" value="' . $txt['pmx_update_all'] . '" onclick="pmxUpdateCats(\'all\')" /> </div> </div> </div>'; // end categorie popup // start filter popup echo ' <div id="pmxSetFilter" class="smalltext" style="width:280px;z-index:9999;margin-top:-60px;padding-top:36px;display:none;"> ' . pmx_popupHeader('pmxSetFilter', $txt['pmx_article_setfilter']) . ' <div style="padding-bottom:3px; margin-top:-4px;">' . $txt['pmx_article_filter_category'] . '<span style="float:right; cursor:pointer" onclick="pmxSetFilterCatClr()">[<b>' . $txt['pmx_article_filter_categoryClr'] . '</b>]</span></div> <select id="pWind.filter.category" style="width:100%;" size="4" multiple="multiple">'; $selcats = array_merge(array(PortaMx_getDefaultCategory($txt['pmx_categories_none'])), $categories); $ordercats = array_merge(array(0), $context['pmx']['catorder']); $catfilter = Pmx_StrToArray($_SESSION['PortaMx']['filter']['category']); $isWriter = allowPmx('pmx_create, pmx_articles', true); $isAdm = allowPmx('pmx_admin'); foreach ($ordercats as $catorder) { $cat = PortaMx_getCatByOrder($selcats, $catorder); $cfg = unserialize($cat['config']); if (!empty($isAdm) || !empty($isWriter) && empty($cfg['global'])) { echo ' <option value="' . $cat['id'] . '"' . (in_array($cat['id'], $catfilter) ? ' selected="selected"' : '') . '>' . str_repeat('•', $cat['level']) . ' ' . $cat['name'] . '</option>'; } } echo ' </select><br /> <div style="height:22px;padding-top:4px;"> ' . $txt['pmx_article_filter_approved'] . ' <input id="pWind.filter.approved" style="float:right;" class="input_check" type="checkbox" value="1"' . (!empty($_SESSION['PortaMx']['filter']['approved']) ? ' checked="checked"' : '') . ' /> </div> <div style="height:22px;"> ' . $txt['pmx_article_filter_active'] . ' <input id="pWind.filter.active" style="float:right;" class="input_check" type="checkbox" value="1"' . (!empty($_SESSION['PortaMx']['filter']['active']) ? ' checked="checked"' : '') . ' /> </div>'; if (allowPmx('pmx_articles, pmx_admin')) { echo ' <div style="height:22px;"> ' . $txt['pmx_article_filter_myown'] . ' <input id="pWind.filter.myown" style="float:right;" class="input_check" type="checkbox" value="1"' . (!empty($_SESSION['PortaMx']['filter']['myown']) ? ' checked="checked"' : '') . ' /> </div> <div style="height:18px;"> ' . $txt['pmx_article_filter_member'] . ' <input id="pWind.filter.member" style="float:right;width:130px;" class="input_text" type="text" value="' . $_SESSION['PortaMx']['filter']['member'] . '" /> </div>' . $txt['pmx_article_filter_membername']; } echo ' <div style="text-align:right;margin-top:-5px;"> <input class="button_submit" type="button" value="' . $txt['set_article_filter'] . '" onclick="pmxSendFilter()" /> <div style="height:20px;"></div> </div> </div> </div>'; $filterActive = $_SESSION['PortaMx']['filter']['category'] != '' || $_SESSION['PortaMx']['filter']['approved'] != 0 || $_SESSION['PortaMx']['filter']['active'] != 0 || $_SESSION['PortaMx']['filter']['myown'] != 0 || $_SESSION['PortaMx']['filter']['member'] != ''; // end filter popup echo ' </td> <td class="tdnogrid" style="width:63px;"></td> <td class="tdnogrid" style="width:45px;"></td> <td class="tdnogrid" style="width:84px;">'; // start blocktype selection popup $RegBlocks = $context['pmx']['RegBlocks']; foreach ($RegBlocks as $key => $val) { if (!in_array($key, array('html', 'script', 'bbc_script', 'php'))) { unset($RegBlocks[$key]); } } function cmpBDesc($a, $b) { return strcasecmp(str_replace(' ', '', $a["description"]), str_replace(' ', '', $b["description"])); } uasort($RegBlocks, 'cmpBDesc'); // start articletype selection popup echo ' <div id="pmxArticleType" class="smalltext" style="width:220px;z-index:9999;margin-top:-30px;display:none;"> ' . pmx_popupHeader('pmxArticleType', $txt['pmx_add_new_articletype'], '65px') . ' <div style="margin:-4px 0 5px 0;">' . $txt['pmx_articles_articletype'] . '</div> <select id="pmx.article.type" style="width:120px;" size="1">'; foreach ($RegBlocks as $type => $articleType) { echo ' <option value="' . $type . '">' . $articleType['description'] . '</option>'; } echo ' </select> <div style="text-align:right; margin-top:-23px;"> <input class="button_submit" type="button" value="' . $txt['pmx_create'] . '" onclick="pmxSendArticleType()" /> </div> </div> </div>'; // end popup // start Access popup echo ' <div id="pmxSetAcs" class="smalltext" style="width:210px;z-index:9999;display:none;margin-top:-30px;"> ' . pmx_popupHeader('pmxSetAcs', $txt['pmx_article_groups']) . ' <div style="height:15px;margin-top:-5px;"> <input id="pWindAcsModeupd" onclick="pmxSetAcsMode(\'upd\')" class="input_check" type="radio" name="_" value="" /><span style="vertical-align:3px; padding:0 3px;">' . $txt['pmx_acs_repl'] . '</span> </div> <div style="height:15px;"> <input id="pWindAcsModeadd" onclick="pmxSetAcsMode(\'add\')" class="input_check" type="radio" name="_" value="" /><span style="vertical-align:3px; padding:0 3px;">' . $txt['pmx_acs_add'] . '</span> </div> <div style="height:15px;margin-bottom:10px;"> <input id="pWindAcsModedel" onclick="pmxSetAcsMode(\'del\')" class="input_check" type="radio" name="_" value="" /><span style="vertical-align:3px; padding:0 3px;">' . $txt['pmx_acs_rem'] . '</span> </div> <select id="pWindAcsGroup" style="width:100%;" multiple="multiple" size="6" onchange="changed(\'pWindAcsGroup\');">'; foreach ($cfg_smfgroups as $grp) { echo ' <option value="' . $grp['id'] . '=1">' . $grp['name'] . '</option>'; } echo ' </select><br /> <script type="text/javascript"> var pWindAcsGroup = new MultiSelect("pWindAcsGroup"); </script> <div style="text-align:right; margin-top:7px;"> <input class="button_submit" type="button" value="' . $txt['pmx_update_save'] . '" onclick="pmxUpdateAcs()" /> <input id="acs_all_button" class="button_submit" type="button" value="' . $txt['pmx_update_all'] . '" onclick="pmxUpdateAcs(\'all\')" /> </div> </div> </div>'; // end Access popup // start clone popup echo ' <div id="pmxSetArtClone" class="smalltext" style="width:220px;z-index:9999;margin-top:-30px;display:none;"> ' . pmx_popupHeader('pmxSetArtClone', $txt['pmx_art_clone']) . ' <div>' . $txt['pmx_confirm_artclone'] . '</div> <input id="pWind.artcloneid" type="hidden" value="" /> <input style="float:right;font-size:11px;font-weight:bold;margin-top:5px;" class="button_submit" type="button" value="' . $txt['pmx_delete_button'] . '" onclick="pmxSendArtClone()" /> <div style="height:25px;"></div> </div> </div>'; // end clone popup // start delete popup echo ' <div id="pmxSetArtDelete" class="smalltext" style="width:220px;z-index:9999;margin-top:-30px;display:none;"> ' . pmx_popupHeader('pmxSetArtDelete', $txt['pmx_art_delete']) . ' <div>' . $txt['pmx_confirm_artdelete'] . '</div> <input id="pWind.artdelid" type="hidden" value="" /> <input style="float:right;font-size:11px;font-weight:bold;margin-top:5px;" class="button_submit" type="button" value="' . $txt['pmx_delete_button'] . '" onclick="pmxSendArtDelete()" /> <div style="height:25px;"></div> </div> </div>'; // end delete popup echo ' </td> <td class="tdnogrid" style="width:84px;"></td> </tr> </table> </div>'; } elseif ($context['pmx']['subaction'] == 'edit' || $context['pmx']['subaction'] == 'editnew') { echo ' <table class="pmx_table" style="margin-bottom:5px;table-layout:fixed;"> <tr> <td style="text-align:center"> <div class="cat_bar" style="border-bottom-left-radius:6px;border-bottom-right-radius:6px"> <h3 class="catbg"> ' . $txt['pmx_article_edit'] . ' ' . $txt['pmx_articles_types'][$context['pmx']['editarticle']->cfg['ctype']] . ' </h3> </div> </td> </tr>'; // call the ShowAdmArticleConfig() methode $context['pmx']['editarticle']->pmxc_ShowAdmArticleConfig(); echo ' </table>'; } echo ' </form>'; }