function getLinks($id_value, $name = "item_link", $class = "", $script = "", $linkPref = null, $lang = "") { global $VIEWLang; if ($lang != '') { $VIEWLang = $lang; } $result = "<select name=\"{$name}\" id=\"{$name}\" class=\"{$class}\" {$script}>\n"; //if ($id_value == null || $id_value == "") $result .= "<option></option>\n"; $result .= '<option value="#">--------</option>'; //$result .= "<option value='#'>$linkPref</option>\n"; $langStmt = " lang='" . $VIEWLang . "' "; // Pages $result .= addToCombobox("Text Pages", "id", "title", "pages_pages", $langStmt, $linkPref . $VIEWLang . "/Page#ID#/#TITLE#", $id_value); // Forms $result .= addToCombobox("Forms", "id", "form_name", "qforms_qforms", $langStmt, $linkPref . $VIEWLang . "/Form#ID#/#TITLE#", $id_value); // Gallery $result .= addToCombobox("Galleries", "id", "name", "galleries_galleries", $langStmt, $linkPref . $VIEWLang . "/Gallery#ID#/#TITLE#", $id_value); $result .= addToCombobox("College", "id", "name_" . $VIEWLang, "college", '', $linkPref . $VIEWLang . "/College#ID#", $id_value); $result .= addToCombobox("Directorates", "id", "name_" . $VIEWLang, "st_directorates", '', $linkPref . $VIEWLang . "/Directorates#ID#", $id_value); $result .= addToCombobox("Publication", "id", "name_" . $VIEWLang, "publication_type", '', $linkPref . $VIEWLang . "/Publication/Type#ID#/", $id_value); $result .= addToCombobox("CL", "id", "name_" . $VIEWLang, "lab_type", '', $linkPref . $VIEWLang . "/CL/Type#ID#/#TITLE#", $id_value); $result .= addToCombobox("Boards", "id", "name_" . $VIEWLang, "st_league_council", '', $linkPref . $VIEWLang . "/Council#ID#", $id_value); // Modules $result .= '<optgroup label="Modules">'; $res = mysql_query("select * from menu_modules where active=1 "); while ($row = mysql_fetch_array($res)) { $sel = ''; $Mpage = $linkPref . $VIEWLang . '/' . $row['page']; if ($id_value == $Mpage) { $sel = " selected "; } $result .= '<option value="' . $Mpage . '" ' . $sel . ' >' . $row['name'] . '</option>'; } $result .= "</optgroup>\n"; // Subject Types if (chechUserPermissions('listSubjects')) { $result .= addToCombobox("Subject Types", "id", "name_" . $VIEWLang, "subjects_types", "", $linkPref . $VIEWLang . "/AllSubjects#ID#/#TITLE#", $id_value); } if (chechUserPermissions('listProducts')) { $result .= addToCombobox("Products Categories", "id", "name_en", "products_category", "", $linkPref . $VIEWLang . "/Products/C#ID#/#TITLE#", $id_value); } $result .= "</select>\n"; return $result; }
function getLinks($id_value, $lang, $name = "item_link", $class = "", $script = "", $linkPref = null) { $result = "<select name=\"{$name}\" id=\"{$name}\" class=\"{$class}\" {$script}>\n"; //if ($id_value == null || $id_value == "") $result .= "<option></option>\n"; $result .= "<option value='#'>--------</option>\n"; $result .= "<option value='index.php'>Home</option>\n"; if ($lang) { $langStmt = "lang='{$lang}'"; } // Pages $result .= addToCombobox("Text Pages", "id", "title", "pages_pages", $langStmt, $linkPref . "view/pages/viewPages.php?id=#ID#", $id_value); // Forms $result .= addToCombobox("Forms", "id", "form_name", "qforms_qforms", $langStmt, $linkPref . "view/qforms/viewQforms.php?id=#ID#", $id_value); // Gallery $result .= addToCombobox("Galleries", "id", "gallery_name_en", "galleries_galleries", "isGallery=1", $linkPref . "view/galleries/viewGalleries.php?id=#ID#", $id_value); // Modules $result .= '<optgroup label="Modules">'; $res = mysql_query("select * from menu_modules where active=1 "); while ($row = mysql_fetch_array($res)) { $sel = ''; if ($id_value == $row['page']) { $sel = " selected "; } $result .= '<option value="' . $row['page'] . '" ' . $sel . ' >' . $row['name'] . '</option>'; } $result .= "</select>\n"; $result .= "</optgroup>\n"; return $result; }