GetDb(); #****************************************************************************** # global vars definition #****************************************************************************** # this var is used to store any error that may occur. $error = ""; # this one is used later to store all the css found, because they won't appear in the dropdown $csslist = array(); $type = ""; #****************************************************************************** # we now get the parameters #****************************************************************************** # getting variables if (isset($_GET["type"])) $type = $_GET["type"] ; else $error = lang('typenotvalid'); if (isset($_GET["id"])) $id = $_GET["id"] ; else $error = lang('idnotvalid'); # if type is template, we get the name if (isset($type) && "template" == $type) { $query = "SELECT css_name FROM ".cms_db_prefix()."css WHERE css_id = ?"; $result = $db->Execute($query, array($id)); if ($result) { $line = $result->FetchRow(); $name = $line["css_name"]; } else { $error = lang('errorretrievingtemplate'); } } #****************************************************************************** # first getting all user permissions #****************************************************************************** $userid = get_userid(); $modify = check_permission($userid, 'Modify Stylesheet Assoc'); $modifytpl = check_permission($userid,'Modify Templates'); $delasso = check_permission($userid, 'Remove Stylesheet Assoc'); $addasso = check_permission($userid, 'Add Stylesheet Assoc'); $query = "SELECT assoc_to_id, template_name FROM ".cms_db_prefix()."css_assoc, ".cms_db_prefix()."templates WHERE assoc_type=? AND assoc_css_id = ? AND assoc_to_id = template_id"; $result = $db->Execute($query, array($type, $id)); #****************************************************************************** # displaying erros if any #****************************************************************************** if (isset($_GET["message"])) { $message = preg_replace('/\','',$_GET['message']); echo '
".$error."
".lang('noaccessto', array(lang('addcssassociation')))."
| ".lang('title')." | \n"; echo "\n"; echo " | ||
|---|---|---|---|
| ".$one["template_name"]." | \n"; } else { echo "".$one['template_name']." | \n"; } # if user has right to delete if ($modify || $delasso) { echo ""; echo $themeObject->DisplayImage('icons/system/delete.gif', lang('delete'),'','','systemicon'); echo " | \n"; } else { echo ""; } echo " |