3 // Display icons and allow user to edit their names or delete some
9 // Get all icons associated with a user
10 $icons = db_query("select * from icons where owner = $page_owner");
11 if ($page_owner != $_SESSION['userid']) {
12 $currenticon = db_query("select icons.filename, users.icon from users join icons on icons.ident = users.icon where users.ident = $page_owner");
13 $currenticon = $currenticon[0]->filename
;
15 $currenticon = $_SESSION['icon'];
18 $header = gettext("Site pictures"); // gettext variable
25 // If we have some icons, display them; otherwise explain that there isn't anything to edit
26 if (sizeof($icons) > 0) {
28 $desc = gettext("Site pictures are small pictures that act as a representative icon throughout the system."); // gettext variable
30 <form action
="" method
="post" />
35 foreach($icons as $icon) {
36 list($width, $height, $type, $attr) = @getimagesize
(path
. "_icons/data/" . $icon->filename
);
38 $delete = gettext("Delete");
40 <label
for="icons_deletecheckbox">$delete:
41 <input type
="checkbox" id
="icons_deletecheckbox" name
="icons_delete[]" value
="{$icon->ident}" />
44 $defaulticon = htmlentities(stripslashes($icon->description
));
46 <img alt
="{$defaulticon}" src
="{$url}_icons/data/{$icon->filename}" {$attr} />
48 if ($icon->filename
== $currenticon) {
49 $checked = "checked=\"checked\"";
53 $nameLabel = gettext("Name:");//gettext variable
54 $default = gettext("Default:");//gettext variable
57 <input type
="text" name
="description[{$icon->ident}]"
58 value
="{$defaulticon}" />
60 <label
>$default <input type
="radio" name
="defaulticon" value
="{$icon->ident}" {$checked} /></label
>
63 $body .= run("templates:draw", array(
64 'context' => 'databox',
66 'column1' => $column2,
73 if ($_SESSION['icon'] == "default.png") {
74 $checked = "checked = \"checked\"";
78 $noDefault = gettext("No default:");
81 <input type
="radio" name
="defaulticon" value
="-1" {$checked} /></label
>
83 $body .= run("templates:draw", array(
84 'context' => 'databox',
88 $save = gettext("Save"); // gettext variable
91 <input type
="hidden" name
="action" value
="icons:edit" />
92 <input type
="submit" value
=$save />
99 $noneLoaded = gettext("You don't have any site pictures loaded yet."); // gettext variable
108 $run_result .= $body;