diff --git a/e107_admin/download.php b/e107_admin/download.php index 05b731b76..edfbe6025 100644 --- a/e107_admin/download.php +++ b/e107_admin/download.php @@ -11,9 +11,9 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_admin/download.php,v $ -| $Revision: 1.16 $ -| $Date: 2008-12-14 10:38:52 $ -| $Author: e107steved $ +| $Revision: 1.17 $ +| $Date: 2009-07-17 02:28:49 $ +| $Author: e107coders $ +----------------------------------------------------------------------------+ */ @@ -50,7 +50,11 @@ $pst->page = array("download.php?create","download.php?cat"); // display preset $pst->id = array("admin_downloads","admin_dl_cat"); // ------------------------------- + +$rs = new form; +$frm = new e_form; $download = new download; + require_once("auth.php"); $pst->save_preset(); // unique name(s) for the presets - comma separated. @@ -61,7 +65,8 @@ $pst->page = "download.php?create"; // display preset options on which page. $pst->save_preset("admin_downloads"); // unique name for the preset */ -$rs = new form; + + $sub_action = ''; if (e_QUERY) { @@ -538,7 +543,7 @@ exit; -class download +class download { function show_existing_items($action, $sub_action, $id, $from, $amount) { @@ -1680,9 +1685,9 @@ class download $ns->tablerender(DOWLAN_39, $text); } - function create_category($sub_action, $id) + function create_category($sub_action, $id) { - global $sql, $tp, $admin_log; + global $sql, $tp, $admin_log, $frm; $download_category_name = $tp->toDB($_POST['download_category_name']); $download_category_description = $tp->toDB($_POST['download_category_description']); $download_category_icon = $tp->toDB($_POST['download_category_icon']); diff --git a/e107_admin/menus.php b/e107_admin/menus.php index fedfb094c..8eb8f9522 100644 --- a/e107_admin/menus.php +++ b/e107_admin/menus.php @@ -10,8 +10,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_admin/menus.php,v $ -| $Revision: 1.30 $ -| $Date: 2009-07-16 02:55:18 $ +| $Revision: 1.31 $ +| $Date: 2009-07-17 02:28:49 $ | $Author: e107coders $ +----------------------------------------------------------------------------+ */ @@ -65,6 +65,7 @@ if($_POST) if (strpos(e_QUERY, 'configure') === FALSE) { + $men->menuScanMenus(); $text .= $men->menuRenderMessage(); $text .= $men->menuSelectLayout(); $text .= $men->menuVisibilityOptions(); diff --git a/e107_files/shortcode/iconpicker.php b/e107_files/shortcode/iconpicker.php index 738e6363c..1f6b4f244 100644 --- a/e107_files/shortcode/iconpicker.php +++ b/e107_files/shortcode/iconpicker.php @@ -1,7 +1,7 @@ replaceConstants($icon); + $filepath_abs = $tp->replaceConstants($icon,"abs"); $icon_file = basename($filepath_abs); $str = "{$icon_file}"; diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php index e21b77e17..fd1943701 100644 --- a/e107_handlers/e_parse_class.php +++ b/e107_handlers/e_parse_class.php @@ -9,8 +9,8 @@ * Text processing and parsing functions * * $Source: /cvs_backup/e107_0.8/e107_handlers/e_parse_class.php,v $ -* $Revision: 1.52 $ -* $Date: 2009-03-08 18:48:12 $ +* $Revision: 1.53 $ +* $Date: 2009-07-17 02:28:49 $ * $Author: e107coders $ * */ @@ -1164,9 +1164,9 @@ class e_parse // // only an ADMIN user can convert {e_ADMIN} // - function replaceConstants($text, $nonrelative = "", $all = false) + function replaceConstants($text, $mode = "", $all = false) { - if($nonrelative != "") + if($mode != "") { global $IMAGES_DIRECTORY, $PLUGINS_DIRECTORY, $FILES_DIRECTORY, $THEMES_DIRECTORY,$DOWNLOADS_DIRECTORY,$ADMIN_DIRECTORY; $replace_relative = array("", @@ -1177,7 +1177,22 @@ class e_parse $FILES_DIRECTORY, $THEMES_DIRECTORY, $DOWNLOADS_DIRECTORY); - $replace_absolute = array(SITEURL, + + if($mode == "abs") + { + $replace_absolute = array("/", + e_IMAGE_ABS, + e_THEME_ABS, + e_IMAGE_ABS, + e_PLUGIN_ABS, + e_FILE_ABS, + e_THEME_ABS, + e_DOWNLOAD_ABS + ); + } + elseif($mode == "full") + { + $replace_absolute = array(SITEURL, SITEURL.$IMAGES_DIRECTORY, SITEURL.$THEMES_DIRECTORY, SITEURL.$IMAGES_DIRECTORY, @@ -1185,13 +1200,17 @@ class e_parse SITEURL.$FILES_DIRECTORY, SITEURL.$THEMES_DIRECTORY, SITEURL.$DOWNLOADS_DIRECTORY); + } + $search = array("{e_BASE}","{e_IMAGE_ABS}","{e_THEME_ABS}","{e_IMAGE}","{e_PLUGIN}","{e_FILE}","{e_THEME}","{e_DOWNLOAD}"); + if (ADMIN) { $replace_relative[] = $ADMIN_DIRECTORY; $replace_absolute[] = SITEURL.$ADMIN_DIRECTORY; $search[] = "{e_ADMIN}"; } + if ($all) { if (USER) @@ -1206,9 +1225,11 @@ class e_parse } $search[] = "{USERID}"; } - $replace = ((string)$nonrelative == "full" ) ? $replace_absolute : $replace_relative; + + $replace = ((string)$mode == "full" || (string)$mode=='abs' ) ? $replace_absolute : $replace_relative; return str_replace($search,$replace,$text); } + // $pattern = ($all ? "#\{([A-Za-z_0-9]*)\}#s" : "#\{(e_[A-Z]*)\}#s"); $pattern = ($all ? "#\{([A-Za-z_0-9]*)\}#s" : "#\{(e_[A-Z]*(?:_ABS){0,1})\}#s"); $text = preg_replace_callback($pattern, array($this, 'doReplace'), $text); diff --git a/e107_handlers/menu_class.php b/e107_handlers/menu_class.php index b22a9dd87..3ab5da395 100644 --- a/e107_handlers/menu_class.php +++ b/e107_handlers/menu_class.php @@ -10,9 +10,9 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_handlers/menu_class.php,v $ -| $Revision: 1.2 $ -| $Date: 2009-07-16 19:19:07 $ -| $Author: e107steved $ +| $Revision: 1.3 $ +| $Date: 2009-07-17 02:28:49 $ +| $Author: e107coders $ +----------------------------------------------------------------------------+ */ if (!defined('e107_INIT')) { exit; } @@ -375,7 +375,7 @@ class menuManager{ if($sql->db_Insert("menus", " 0, '{$file['fname']}', 0, 0, 0, '' ,'{$file['path']}', ''")) { // Could do admin logging here - but probably not needed - $message .= "".MENLAN_10." - ".$file['fname']."
"; + $message .= MENLAN_10." - ".$file['fname']."
"; } } } @@ -402,11 +402,12 @@ class menuManager{ if (stristr($menustr, $menu_name) === FALSE) { $sql2->db_Delete("menus", "menu_name='$menu_name'"); - $message .= "".MENLAN_11." - ".$menu_name."
"; + $message .= MENLAN_11." - ".$menu_name."
"; } } - echo $message; + $this->menuAddMessage($message, E_MESSAGE_INFO); + } // --------------------------------------------------------------------------- diff --git a/e107_plugins/download/handlers/adminDownload_class.php b/e107_plugins/download/handlers/adminDownload_class.php index 730a0ff2c..12cb2d50d 100644 --- a/e107_plugins/download/handlers/adminDownload_class.php +++ b/e107_plugins/download/handlers/adminDownload_class.php @@ -11,9 +11,9 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/download/handlers/adminDownload_class.php,v $ -| $Revision: 1.6 $ -| $Date: 2009-07-16 23:07:30 $ -| $Author: bugrain $ +| $Revision: 1.7 $ +| $Date: 2009-07-17 02:28:49 $ +| $Author: e107coders $ | +----------------------------------------------------------------------------+ */ @@ -51,42 +51,39 @@ class adminDownload extends download $eform = new e_form(); $filterColumns = ($pref['admin_download_disp'] ? explode("|",$pref['admin_download_disp']) : array("download_name","download_class")); - if ($this->advancedSearchFields) - { - $showBasicSearch = " style='display:none'"; - $showAdvancedSearch = ""; - } - else - { - $showBasicSearch = ""; - $showAdvancedSearch = " style='display:none'"; - } + // Search field $text .= "
-
"; - // Advanced search fields + // Advanced search fields {$showAdvancedSearch} $text .= "
-
"; return $text; @@ -192,7 +184,14 @@ class adminDownload extends download $eform = new e_form(); $sortorder = $subAction ? $subAction : $pref['download_order']; $sortdirection = $id=="asc" ? "asc" : "desc"; - $sort_link = $sortdirection == 'asc' ? 'desc' : 'asc'; + $amount = 10; + if(!$sortorder) + { + $sortorder = "download_id"; + } + + $sort_link = $sortdirection == 'asc' ? 'desc' : 'asc'; + $columnInfo = array( "download_id" => array("title"=>DOWLAN_67, "type"=>"", "width"=>"auto", "thclass"=>"center first", "url"=>e_SELF."?main.download_id.{$sort_link}.{$from}", "forced"=>true), "download_name" => array("title"=>DOWLAN_12, "type"=>"", "width"=>"auto", "thclass"=>"", "url"=>e_SELF."?main.download_name.{$sort_link}.{$from}"), @@ -216,7 +215,7 @@ class adminDownload extends download "options" => array("title"=>LAN_OPTIONS, "width"=>"auto", "thclass"=>"center last", "url"=>"", "forced"=>true) ); - $filterColumns = ($user_pref['admin_download_disp']) ? $user_pref['admin_download_disp'] : array("download_id","download_name","download_class","options"); + $filterColumns = ($user_pref['admin_download_disp']) ? $user_pref['admin_download_disp'] : array("download_name","download_class"); $query = "SELECT d.*, dc.* FROM `#download` AS d LEFT JOIN `#download_category` AS dc ON dc. download_category_id=d.download_category"; if ($this->searchField) { @@ -306,12 +305,14 @@ class adminDownload extends download while ($row = $sql->db_Fetch()) { $mirror = strlen($row['download_mirror']) > 0; - $rowStyle = ($rowStyle == "odd") ? "even" : "odd"; - $text .= "".$row['download_id'].""; + + $text .= "\n".$row['download_id']."\n"; // Display Chosen options + foreach($filterColumns as $disp) { + switch ($disp) { case "download_name" : @@ -1148,7 +1149,7 @@ class adminDownload extends download global $download, $sql, $sql2, $rs, $ns, $tp, $pst; require_once(e_HANDLER."form_handler.php"); - $eform = new e_form(); + $frm = new e_form(); $text = $rs->form_open("post", e_SELF."?".e_QUERY, "myform"); $text .= "
"; @@ -1167,7 +1168,7 @@ class adminDownload extends download $cat_array[$cat['download_category_parent']][] = $cat; } $text .= " - +
@@ -1175,12 +1176,15 @@ class adminDownload extends download - - - - - - "; + + + + + + + + + "; //Start displaying parent categories @@ -1296,7 +1300,7 @@ class adminDownload extends download } - $text .= "
".DOWLAN_11."".DOWLAN_52."".LAN_ORDER."".LAN_OPTIONS."
".DOWLAN_11."".DOWLAN_52."".LAN_ORDER."".LAN_OPTIONS."
"; + $text .= ""; $text .= "
"; @@ -1337,83 +1341,60 @@ class adminDownload extends download $preset = $pst->read_preset("admin_dl_cat"); // read preset values into array extract($preset); - $eform_action = (isset($_POST['add_category'])) ? e_SELF."?cat" : e_SELF."?".e_QUERY; + $frm_action = (isset($_POST['add_category'])) ? e_SELF."?cat" : e_SELF."?".e_QUERY; $text = "
-
- - - - - + +
+ + + + - - + + - $text .= $this->getCategorySelectList($main_category_parent, false, false, DOWLAN_40); - $text .= " - - + + + - - + + - - + + - - + + - while (list($key, $icon) = each($iconlist)) { - $text .= " "; - } - - $text .= " - - - - "; + + + - $text .= " - - - - +
".DOWLAN_37.": "; + ".DOWLAN_37.": ". $this->getCategorySelectList($main_category_parent, false, false, DOWLAN_40)."
".DOWLAN_12.": - -
".DOWLAN_12.":
".DOWLAN_18.": "; - $text .= $eform->bbarea('download_category_description',$download_category_description); - $text .= "".DOWLAN_18.": ".$frm->bbarea('download_category_description',$download_category_description)."
".DOWLAN_41.": - - - ".DOWLAN_41.": ".$frm->iconpicker('download_category_icon', $download_category_icon, DOWLAN_42) ."
".DOWLAN_147.": - - - ".DOWLAN_147.": ".$frm->iconpicker('download_category_icon_empty', $download_category_icon_empty, DOWLAN_42) ."
".DOWLAN_43.":
(".DOWLAN_44.")
".r_userclass("download_category_class", $download_category_class, 'off', 'public, nobody, member, admin, classes, language')." -
".DOWLAN_43.":
(".DOWLAN_44.")
".r_userclass("download_category_class", $download_category_class, 'off', 'public, nobody, member, admin, classes, language')."
"; - if ($id && $subAction == "edit" && !isset($_POST['add_category'])) { - $text .= " "; - } else { - $text .= ""; - } - $text .= "
+ +
"; + + if ($id && $subAction == "edit" && !isset($_POST['add_category'])) { + $text .= " "; + } else { + $text .= ""; + } + + $text .= "
"; + $ns->tablerender(DOWLAN_39, $text); }