diff --git a/e107_plugins/links_page/admin_linkspage_config.php b/e107_plugins/links_page/admin_linkspage_config.php index 7d69fd6d6..d4f5b6028 100644 --- a/e107_plugins/links_page/admin_linkspage_config.php +++ b/e107_plugins/links_page/admin_linkspage_config.php @@ -33,7 +33,8 @@ require_once(e_PLUGIN.'links_page/link_defines.php'); require_once(e_ADMIN.'auth.php'); require_once(e_HANDLER.'userclass_class.php'); require_once(e_HANDLER.'form_handler.php'); -$rs = new form; +$rs = new form; // FIX v2 style? +$frm = e107::getForm(); require_once(e_HANDLER.'file_class.php'); $fl = new e_file; e107_require_once(e_HANDLER.'arraystorage_class.php'); diff --git a/e107_plugins/links_page/languages/English_admin_links_page.php b/e107_plugins/links_page/languages/English_admin_links_page.php index 2fa647176..58f371dd9 100644 --- a/e107_plugins/links_page/languages/English_admin_links_page.php +++ b/e107_plugins/links_page/languages/English_admin_links_page.php @@ -37,7 +37,7 @@ define("LCLAN_PAGETITLE_9", "Submit Link"); define("LCLAN_PAGETITLE_10", ""); -define("LCLAN_OPT_1", "general options"); +//define("LCLAN_OPT_1", "general options"); define("LCLAN_OPT_2", "Link Page Options"); define("LCLAN_OPT_3", "enabled"); define("LCLAN_OPT_4", "disabled"); @@ -126,7 +126,7 @@ define("LCLAN_OPT_85", "caption menu"); define("LCLAN_OPT_86", "link menu"); define("LCLAN_OPT_87", "show amount of links"); -define("LCLAN_ADMIN_1", "update"); // deprecated +//define("LCLAN_ADMIN_1", "update"); // deprecated define("LCLAN_ADMIN_2", "Link saved to database."); define("LCLAN_ADMIN_3", "Link updated in database."); define("LCLAN_ADMIN_4", "Link Category Saved"); @@ -205,7 +205,7 @@ define("LCLAN_ITEM_10", "The"); define("LCLAN_ITEM_11", "folder is not writable, you need to CHMOD 777 the folder before uploading"); define("LCLAN_ITEM_12", "px"); define("LCLAN_ITEM_13", "upload"); -define("LCLAN_ITEM_14", "Choose an icon:"); +define("LCLAN_ITEM_14", "Choose an icon:"); define("LCLAN_ITEM_15", "View Images"); define("LCLAN_ITEM_16", "Open Type:"); define("LCLAN_ITEM_17", "Opens in same window"); diff --git a/e107_plugins/links_page/link_class.php b/e107_plugins/links_page/link_class.php index a3cc90ee2..61b7b8f56 100644 --- a/e107_plugins/links_page/link_class.php +++ b/e107_plugins/links_page/link_class.php @@ -650,7 +650,11 @@ class linkclass function show_link_create() { - global $sql, $rs, $qs, $ns, $fl, $linkspage_pref, $e_event; + global $rs, $qs, $linkspage_pref, $e_event; + $sql = e107::getDb(); + $frm = e107::getForm(); + $ns = e107::getRender(); + $fl = e107::getFile(); $row['link_category'] = ""; $row['link_name'] = ""; @@ -695,12 +699,11 @@ class linkclass } $width = (e_PAGE == "admin_linkspage_config.php" ? ADMIN_WIDTH : "width:100%;"); $text = " -
".LCLAN_ITEM_2." | -"; + | ".LCLAN_ITEM_2." | +";
if (!$link_cats = $sql->db_Select("links_page_cat")) {
$text .= LCLAN_ITEM_3." "; @@ -719,26 +722,26 @@ class linkclass |
||||
".LCLAN_ITEM_4." | -+ | ".LCLAN_ITEM_4." | +".$rs -> form_text("link_name", 60, $row['link_name'], 100)." | ||||
".LCLAN_ITEM_5." | -+ | ".LCLAN_ITEM_5." | +".$rs -> form_text("link_url", 60, $row['link_url'], 200)." | ||||
".LCLAN_ITEM_6." | -+ | ".LCLAN_ITEM_6." | +".$rs -> form_textarea("link_description", '59', '3', $row['link_description'], "", "", "", "", "")." | ||||
".LCLAN_ITEM_7." | -"; + | ".LCLAN_ITEM_7." | +";
if(!FILE_UPLOADS){
$text .= "".LCLAN_ITEM_9."";
}else{
@@ -748,7 +751,7 @@ class linkclass
$text .= "
".LCLAN_ITEM_8." ".$rs -> form_text("link_resize_value", 3, $link_resize_value, 3)." ".LCLAN_ITEM_12." - ".$rs -> form_button("submit", "uploadlinkicon", LCLAN_ITEM_13, "", "", ""); + ".$frm->admin_button('uploadlinkicon', LCLAN_ITEM_13, 'submit'); } $text .= " |
@@ -758,73 +761,74 @@ class linkclass
$iconpath = e_PLUGIN."links_page/link_images/";
$iconlist = $fl->get_files($iconpath);
$iconpath = e_PLUGIN_ABS."links_page/link_images/"; // Absolute paths now we've got the files
-
+ // TODO FIX - needs replacement with up-to-date form handling, see below.
$text .= "
||||
".LCLAN_ITEM_14." | -
-
-
|
+ ".LCLAN_ITEM_14." | +
+
+
|
||||
".LCLAN_ITEM_16." | -- ".$rs -> form_select_open("linkopentype")." - ".$rs -> form_option(LCLAN_ITEM_17, ($row['link_open'] == "0" ? "1" : "0"), "0", "")." - ".$rs -> form_option(LCLAN_ITEM_18, ($row['link_open'] == "1" ? "1" : "0"), "1", "")." - ".$rs -> form_option(LCLAN_ITEM_19, ($row['link_open'] == "4" ? "1" : "0"), "4", "")." - ".$rs -> form_select_close()." - | +".LCLAN_ITEM_16." | ++ ".$rs -> form_select_open("linkopentype")." + ".$rs -> form_option(LCLAN_ITEM_17, ($row['link_open'] == "0" ? "1" : "0"), "0", "")." + ".$rs -> form_option(LCLAN_ITEM_18, ($row['link_open'] == "1" ? "1" : "0"), "1", "")." + ".$rs -> form_option(LCLAN_ITEM_19, ($row['link_open'] == "4" ? "1" : "0"), "4", "")." + ".$rs -> form_select_close()." + | ||||
".LCLAN_ITEM_20." | -+ | ".LCLAN_ITEM_20." | +".r_userclass("link_class", $row['link_class'], "off", "public,guest,nobody,member,admin,classes")." | ||||
"; + | ";
if (isset($qs[2]) && $qs[2] && $qs[1] == "edit") {
$text .= $rs -> form_hidden("link_datestamp", $row['link_datestamp']);
$text .= $rs -> form_checkbox("update_datestamp", 1, 0)." ".LCLAN_ITEM_21." "; $text .= $rs -> form_button("submit", "add_link", LCLAN_ITEM_22, "", "", "").$rs -> form_hidden("link_id", $row['link_id']).$rs -> form_hidden("link_author", $row['link_author']); } else { - $text .= $rs -> form_button("submit", "add_link", LCLAN_ITEM_23, "", "", ""); + $text .= " + "; } $text .= " |
".LCLAN_ITEM_25." | -".LCLAN_ITEM_26." | -".LCLAN_ITEM_27." | -".LCLAN_ITEM_28." | -".LCLAN_ITEM_29." | +".LCLAN_ITEM_25." | +".LCLAN_ITEM_26." | +".LCLAN_ITEM_27." | +".LCLAN_ITEM_28." | +".LCLAN_ITEM_29." |
".$img." | -+ | ".$img." | +".LINK_ICON_LINK." ".$row['link_name']." | -+ | ".LINK_ICON_EDIT." toJS(LCLAN_ITEM_33." [ ".$row['link_name']." ]")."')\" /> | -+ | ".$up." ".$down." | -+ |
".LCLAN_CAT_13." | -".$rs->form_text("link_category_name", 50, $row['link_category_name'], 200)." | +".LCLAN_CAT_13." | +".$rs->form_text("link_category_name", 50, $row['link_category_name'], 200)." |
".LCLAN_CAT_14." | -".$rs->form_text("link_category_description", 60, $row['link_category_description'], 200)." | +".LCLAN_CAT_14." | +".$rs->form_text("link_category_description", 60, $row['link_category_description'], 200)." |
".LCLAN_CAT_15." | -";
- if(!FILE_UPLOADS){
- $text .= "".LCLAN_CAT_17."";
- }else{
- if(!is_writable(e_PLUGIN."links_page/cat_images/")){
- $text .= "".LCLAN_CAT_18." ".e_PLUGIN."links_page/cat_images/ ".LCLAN_CAT_19." "; + | ".LCLAN_CAT_15." | +";
+ if(!FILE_UPLOADS){
+ $text .= "".LCLAN_CAT_17."";
+ }else{
+ if(!is_writable(e_PLUGIN."links_page/cat_images/")){
+ $text .= "".LCLAN_CAT_18." ".e_PLUGIN."links_page/cat_images/ ".LCLAN_CAT_19." "; + } + $text .= " + + ".LCLAN_CAT_16." ".$rs -> form_text("link_cat_resize_value", 3, $link_cat_resize_value, 3)." ".LCLAN_CAT_20." + ".$frm->admin_button('uploadcatlinkicon', LCLAN_CAT_21, 'submit'); + } - $text .= " - - ".LCLAN_CAT_16." ".$rs -> form_text("link_cat_resize_value", 3, $link_cat_resize_value, 3)." ".LCLAN_CAT_20." - ".$rs -> form_button("submit", "uploadcatlinkicon", LCLAN_CAT_21, "", "", ""); - } - $text .= " - |
+ $text .= "
+
".LCLAN_CAT_22." | -+ | ".LCLAN_CAT_22." | +".$rs -> form_text("link_category_icon", 60, $row['link_category_icon'], 100)." ".$rs -> form_button("button", '', LCLAN_CAT_23, "onclick=\"expandit('catico')\"")." |
".LCLAN_CAT_24." | -+ | ".LCLAN_CAT_24." | +".r_userclass("link_category_class", $row['link_category_class'], "off", "public,guest,nobody,member,admin,classes")." |
"; + | |||
"; if (is_numeric($qs[2])) { $text .= $rs -> form_hidden("link_category_order", $row['link_category_order']); $text .= $rs -> form_hidden("link_category_datestamp", $row['link_category_datestamp']); @@ -1033,7 +1048,7 @@ class linkclass $text .= $rs -> form_button("submit", "category_clear", LCLAN_CAT_27). $rs->form_hidden("link_category_id", $qs[2]); } else { - $text .= $rs -> form_button("submit", "create_category", LCLAN_CAT_28, "", "", ""); + $text .= $frm->admin_button('create_category', LCLAN_CAT_28, 'submit'); // TODO FIX LCLAN_CAT_22 td needs fixing and updating to v2 style, unfunctional atm. - above } $text .= " |
".LCLAN_CAT_1." | -".LCLAN_CAT_2." | -".LCLAN_CAT_3." | "; +".LCLAN_CAT_1." | +".LCLAN_CAT_2." | +".LCLAN_CAT_3." | "; if($mode == "cat"){ $text .= " -".LCLAN_CAT_4." | -".LCLAN_CAT_5." | "; +".LCLAN_CAT_4." | +".LCLAN_CAT_5." | "; } $text .= "
".$img." | -+ | ".$img." | +
".LINK_ICON_LINK."
".$row['link_category_name']." ".$row['link_category_description']." | ";
@@ -1110,15 +1130,15 @@ class linkclass
$down = "";
}
$text .= "
- + | ".LINK_ICON_EDIT." toJS(LCLAN_CAT_8." [ ".$row['link_category_name']." ]")."')\"/> | -+ | ".$up." ".$down." | -+ |