Example #1
0
 public function display_table(Page $page, $extensions, $editable)
 {
     $h_en = $editable ? "<th>Enabled</th>" : "";
     $html = "\n\t\t\t" . make_form(make_link("ext_manager/set")) . "\n\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\t\$(\"#extensions\").tablesorter();\n\t\t\t\t});\n\t\t\t\t</script>\n\t\t\t\t<table id='extensions' class='zebra'>\n\t\t\t\t\t<thead>\n\t\t\t\t\t\t<tr>{$h_en}<th>Name</th><th>Description</th></tr>\n\t\t\t\t\t</thead>\n\t\t\t\t\t<tbody>\n\t\t";
     foreach ($extensions as $extension) {
         if (!$editable && $extension->visibility == "admin") {
             continue;
         }
         $h_name = html_escape(empty($extension->name) ? $extension->ext_name : $extension->name);
         $h_description = html_escape($extension->description);
         if ($extension->enabled === TRUE) {
             $h_enabled = " checked='checked'";
         } else {
             if ($extension->enabled === FALSE) {
                 $h_enabled = "";
             } else {
                 $h_enabled = " disabled checked='checked'";
             }
         }
         $h_link = make_link("ext_doc/" . url_escape($extension->ext_name));
         $h_en = $editable ? "<td><input type='checkbox' name='ext_" . html_escape($extension->ext_name) . "'{$h_enabled}></td>" : "";
         $html .= "\n\t\t\t\t<tr>\n\t\t\t\t\t{$h_en}\n\t\t\t\t\t<td><a href='{$h_link}'>{$h_name}</a></td>\n\t\t\t\t\t<td style='text-align: left;'>{$h_description}</td>\n\t\t\t\t</tr>";
     }
     $h_set = $editable ? "<tfoot><tr><td colspan='5'><input type='submit' value='Set Extensions'></td></tr></tfoot>" : "";
     $html .= "\n\t\t\t\t\t</tbody>\n\t\t\t\t\t{$h_set}\n\t\t\t\t</table>\n\t\t\t</form>\n\t\t";
     $page->set_title("Extensions");
     $page->set_heading("Extensions");
     $page->add_block(new NavBlock());
     $page->add_block(new Block("Extension Manager", $html));
 }
Example #2
0
 public function display_aliases(Page $page, $aliases, $is_admin, $pageNumber, $totalPages)
 {
     if ($is_admin) {
         $action = "<th width='10%'>Action</th>";
         $add = "\n\t\t\t\t<tr>\n\t\t\t\t\t" . make_form(make_link("alias/add")) . "\n\t\t\t\t\t\t<td><input type='text' name='oldtag'></td>\n\t\t\t\t\t\t<td><input type='text' name='newtag'></td>\n\t\t\t\t\t\t<td><input type='submit' value='Add'></td>\n\t\t\t\t\t</form>\n\t\t\t\t</tr>\n\t\t\t";
     } else {
         $action = "";
         $add = "";
     }
     $h_aliases = "";
     $n = 0;
     foreach ($aliases as $old => $new) {
         $h_old = html_escape($old);
         $h_new = "<a href='" . make_link("post/list/" . url_escape($new) . "/1") . "'>" . html_escape($new) . "</a>";
         $oe = $n++ % 2 == 0 ? "even" : "odd";
         $h_aliases .= "<tr class='{$oe}'><td>{$h_old}</td><td>{$h_new}</td>";
         if ($is_admin) {
             $h_aliases .= "\n\t\t\t\t\t<td>\n\t\t\t\t\t\t" . make_form(make_link("alias/remove")) . "\n\t\t\t\t\t\t\t<input type='hidden' name='oldtag' value='{$h_old}'>\n\t\t\t\t\t\t\t<input type='submit' value='Remove'>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</td>\n\t\t\t\t";
         }
         $h_aliases .= "</tr>";
     }
     $html = "\n\t\t\t<script type='text/javascript'>\n\t\t\t\$(document).ready(function() {\n\t\t\t\t\$(\"#aliases\").tablesorter();\n\t\t\t});\n\t\t\t</script>\n\t\t\t<table id='aliases' class='zebra'>\n\t\t\t\t<thead><tr><th>From</th><th>To</th>{$action}</tr></thead>\n\t\t\t\t<tbody>{$h_aliases}</tbody>\n\t\t\t\t<tfoot>{$add}</tfoot>\n\t\t\t</table>\n\t\t\t<p><a href='" . make_link("alias/export/aliases.csv") . "'>Download as CSV</a></p>\n\t\t";
     $bulk_html = "\n\t\t\t" . make_form(make_link("alias/import"), $multipart = True) . "\n\t\t\t\t<input type='file' name='alias_file'>\n\t\t\t\t<input type='submit' value='Upload List'>\n\t\t\t</form>\n\t\t";
     $page->set_title("Alias List");
     $page->set_heading("Alias List");
     $page->add_block(new NavBlock());
     $page->add_block(new Block("Aliases", $html));
     if ($is_admin) {
         $page->add_block(new Block("Bulk Upload", $bulk_html, "main", 51));
     }
     $this->display_paginator($page, "alias/list", null, $pageNumber, $totalPages);
 }
Example #3
0
 private function get_html_for_blotter_editor($entries)
 {
     global $user;
     /**
      * Long function name, but at least I won't confuse it with something else ^_^
      */
     // Add_new stuff goes here.
     $table_header = "\n\t\t\t<tr>\n\t\t\t<th>Date</th>\n\t\t\t<th>Message</th>\n\t\t\t<th>Important?</th>\n\t\t\t<th>Action</th>\n\t\t\t</tr>";
     $add_new = "\n\t\t\t<tr class='even'>\n\t\t\t" . make_form(make_link("blotter/add")) . "\n\t\t\t<td colspan='2'><textarea style='text-align:left;' name='entry_text' rows='2' /></textarea></td>\n\t\t\t<td><input type='checkbox' name='important' /></td>\n\t\t\t<td><input type='submit' value='Add'></td>\n\t\t\t</form>\n\t\t\t</tr>";
     // Now, time for entries list.
     $table_rows = "";
     $num_entries = count($entries);
     for ($i = 0; $i < $num_entries; $i++) {
         /**
          * Add table rows
          */
         $id = $entries[$i]['id'];
         $entry_date = $entries[$i]['entry_date'];
         $entry_text = $entries[$i]['entry_text'];
         if ($entries[$i]['important'] == 'Y') {
             $important = 'Y';
         } else {
             $important = 'N';
         }
         // Add the new table row(s)
         $table_rows .= "<tr>\n\t\t\t\t<td>{$entry_date}</td>\n\t\t\t\t<td>{$entry_text}</td>\n\t\t\t\t<td>{$important}</td>\n\t\t\t\t<td><form name='remove{$id}' method='post' action='" . make_link("blotter/remove") . "'>\n\t\t\t\t" . $user->get_auth_html() . "\n\t\t\t\t<input type='hidden' name='id' value='{$id}' />\n\t\t\t\t<input type='submit' style='width: 100%;' value='Remove' />\n\t\t\t\t</form>\n\t\t\t\t</td>\n\t\t\t\t</tr>";
     }
     $html = "\n\t\t\t<table id='blotter_entries' class='zebra'>\n\t\t\t<thead>{$table_header}</thead>\n\t\t\t<tbody>{$add_new}</tbody>\n\t\t\t<tfoot>{$table_rows}</tfoot>\n\t\t\t</table>\n\n\t\t\t<br />\n\t\t\t<b>Help:</b><br />\n\t\t\t<blockquote>Add entries to the blotter, and they will be displayed.</blockquote>";
     return $html;
 }
Example #4
0
 public function display_advanced(Page $page, $options)
 {
     global $user;
     $rows = "";
     $n = 0;
     ksort($options);
     foreach ($options as $name => $value) {
         $h_value = html_escape($value);
         $len = strlen($h_value);
         $oe = $n++ % 2 == 0 ? "even" : "odd";
         $box = "";
         if (strpos($value, "\n") > 0) {
             $box .= "<textarea cols='50' rows='4' name='_config_{$name}'>{$h_value}</textarea>";
         } else {
             $box .= "<input type='text' name='_config_{$name}' value='{$h_value}'>";
         }
         $box .= "<input type='hidden' name='_type_{$name}' value='string'>";
         $rows .= "<tr class='{$oe}'><td>{$name}</td><td>{$box}</td></tr>";
     }
     $table = "\n\t\t\t<script type='text/javascript'>\n\t\t\t\$(document).ready(function() {\n\t\t\t\t\$(\"#settings\").tablesorter();\n\t\t\t});\n\t\t\t</script>\n\t\t\t" . make_form(make_link("setup/save")) . "\n\t\t\t\t<table id='settings' class='zebra'>\n\t\t\t\t\t<thead><tr><th width='25%'>Name</th><th>Value</th></tr></thead>\n\t\t\t\t\t<tbody>{$rows}</tbody>\n\t\t\t\t\t<tfoot><tr><td colspan='2'><input type='submit' value='Save Settings'></td></tr></tfoot>\n\t\t\t\t</table>\n\t\t\t</form>\n\t\t\t";
     $page->set_title("Shimmie Setup");
     $page->set_heading("Shimmie Setup");
     $page->add_block(new Block("Navigation", $this->build_navigation(), "left", 0));
     $page->add_block(new Block("Setup", $table));
 }
Example #5
0
 public function display_image_banner(Page $page, Image $image)
 {
     global $config;
     $i_image = int_escape($image->id);
     $html = "\n\t\t\t" . make_form(make_link("image_report/add")) . "\n\t\t\t\t<input type='hidden' name='image_id' value='{$i_image}'>\n\t\t\t\t<input type='text' name='reason' value='Please enter a reason' onclick='this.value=\"\";'>\n\t\t\t\t<input type='submit' value='Report'>\n\t\t\t</form>\n\t\t";
     $page->add_block(new Block("Report Image", $html, "left"));
 }
Example #6
0
function admin_topics()
{
    global $_GET;
    global $_POST;
    /*
     * Identify and store the submitted form values to be retained and
     * re-displayed on the form
     */
    $form_attrs['tid'] = $_GET['tid'];
    if (!$form_attrs['tid']) {
        $form_attrs['tid'] = $_POST['tid'];
    }
    $form_attrs['title'] = $_POST['title'];
    $form_attrs['owner'] = $_POST['owner'];
    $form_attrs['role'] = $_POST['role'];
    $form_attrs['approved'] = $_POST['approved'];
    /*
     * Define rules for what database queries should be used
     */
    if ($form_attrs['tid']) {
        $qry_ary['top_list'] = "SELECT topics.id, users.name as owner, t_role AS t_role, " . "DATE_FORMAT( topics.started, \"%e %b %Y\" ) as opened, " . "topics.name AS title, is_approved " . "FROM topics, users " . "WHERE topics.id = '" . $form_attrs['tid'] . "' " . "AND topics.t_owner = users.id";
    }
    /*
     * Create the form
     */
    $form_string = make_form("topics.xml", "", $form_attrs, $qry_ary);
}
Example #7
0
 /**
  * Show a page of aliases.
  *
  * Note: $can_manage = whether things like "add new alias" should be shown
  *
  * @param array $aliases An array of ($old_tag => $new_tag)
  * @param int $pageNumber
  * @param int $totalPages
  */
 public function display_aliases($aliases, $pageNumber, $totalPages)
 {
     global $page, $user;
     $can_manage = $user->can("manage_alias_list");
     if ($can_manage) {
         $h_action = "<th width='10%'>Action</th>";
         $h_add = "\n\t\t\t\t<tr>\n\t\t\t\t\t" . make_form(make_link("alias/add")) . "\n\t\t\t\t\t\t<td><input type='text' name='oldtag'></td>\n\t\t\t\t\t\t<td><input type='text' name='newtag'></td>\n\t\t\t\t\t\t<td><input type='submit' value='Add'></td>\n\t\t\t\t\t</form>\n\t\t\t\t</tr>\n\t\t\t";
     } else {
         $h_action = "";
         $h_add = "";
     }
     $h_aliases = "";
     foreach ($aliases as $old => $new) {
         $h_old = html_escape($old);
         $h_new = "<a href='" . make_link("post/list/" . url_escape($new) . "/1") . "'>" . html_escape($new) . "</a>";
         $h_aliases .= "<tr><td>{$h_old}</td><td>{$h_new}</td>";
         if ($can_manage) {
             $h_aliases .= "\n\t\t\t\t\t<td>\n\t\t\t\t\t\t" . make_form(make_link("alias/remove")) . "\n\t\t\t\t\t\t\t<input type='hidden' name='oldtag' value='{$h_old}'>\n\t\t\t\t\t\t\t<input type='submit' value='Remove'>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</td>\n\t\t\t\t";
         }
         $h_aliases .= "</tr>";
     }
     $html = "\n\t\t\t<table id='aliases' class='sortable zebra'>\n\t\t\t\t<thead><tr><th>From</th><th>To</th>{$h_action}</tr></thead>\n\t\t\t\t<tbody>{$h_aliases}</tbody>\n\t\t\t\t<tfoot>{$h_add}</tfoot>\n\t\t\t</table>\n\t\t\t<p><a href='" . make_link("alias/export/aliases.csv") . "'>Download as CSV</a></p>\n\t\t";
     $bulk_html = "\n\t\t\t" . make_form(make_link("alias/import"), 'post', true) . "\n\t\t\t\t<input type='file' name='alias_file'>\n\t\t\t\t<input type='submit' value='Upload List'>\n\t\t\t</form>\n\t\t";
     $page->set_title("Alias List");
     $page->set_heading("Alias List");
     $page->add_block(new NavBlock());
     $page->add_block(new Block("Aliases", $html));
     if ($can_manage) {
         $page->add_block(new Block("Bulk Upload", $bulk_html, "main", 51));
     }
     $this->display_paginator($page, "alias/list", null, $pageNumber, $totalPages);
 }
Example #8
0
function plug_microform($p, $id)
{
    $rid = 'mfr' . randid();
    //echo $p.'-'.$id;
    $nod = ses('mform', ses('qb') . '_microform_' . $id);
    req('pop');
    ses('mformj', $rid . '_plug___microform_plug*microform_' . ajx($p) . '_' . $id);
    reqp('msql');
    $msq = new msql('', $nod);
    //table
    list($p, $tp) = explode('§', $p);
    $rb = mform_mr($p);
    //p($rb);
    $msq->create($rb);
    $ret .= make_form($p, 'mfr' . $id, '_plug___microform_mform*j_' . ajx($p, '') . '_' . $id . '_') . br();
    if (auth(4)) {
        $ret .= msqlink('users', ses('mform')) . ' ' . btn('txtsmall2', $nod) . ' ';
    }
    if ($tp == 1) {
        $ret .= mform_read($id);
    } elseif ($tp) {
        $ret .= plugin('msqtemplate', $nod, $tp);
    }
    return divd($rid, $ret . $bt);
}
Example #9
0
 public function get_voter_html(Image $image, $is_favorited)
 {
     $i_image_id = int_escape($image->id);
     $name = $is_favorited ? "unset" : "set";
     $label = $is_favorited ? "Un-Favorite" : "Favorite";
     $html = "\n\t\t\t" . make_form(make_link("change_favorite")) . "\n\t\t\t<input type='hidden' name='image_id' value='{$i_image_id}'>\n\t\t\t<input type='hidden' name='favorite_action' value='{$name}'>\n\t\t\t<input type='submit' value='{$label}'>\n\t\t\t</form>\n\t\t";
     return $html;
 }
Example #10
0
 public function dbq_html($terms)
 {
     $h_terms = html_escape($terms);
     $h_reason = "";
     if (class_exists("ImageBan")) {
         $h_reason = "<input type='text' name='reason' placeholder='Ban reason (leave blank to not ban)'>";
     }
     $html = make_form(make_link("admin/delete_by_query"), "POST") . "\n\t\t\t\t<input type='button' class='shm-unlocker' data-unlock-sel='#dbqsubmit' value='Unlock'>\n\t\t\t\t<input type='hidden' name='query' value='{$h_terms}'>\n\t\t\t\t{$h_reason}\n\t\t\t\t<input type='submit' id='dbqsubmit' disabled='true' value='Delete All These Images'>\n\t\t\t</form>\n\t\t";
     return $html;
 }
Example #11
0
 /**
  * @param Image $image
  * @param array $reporters
  */
 public function display_image_banner(Image $image, $reporters)
 {
     global $page;
     $i_image = int_escape($image->id);
     $html = "";
     if (count($reporters) > 0) {
         $html .= "<b>Image reported by " . html_escape(implode(", ", $reporters)) . "</b><p>";
     }
     $html .= "\n\t\t\t" . make_form(make_link("image_report/add")) . "\n\t\t\t\t<input type='hidden' name='image_id' value='{$i_image}'>\n\t\t\t\t<input type='text' name='reason' placeholder='Please enter a reason'>\n\t\t\t\t<input type='submit' value='Report'>\n\t\t\t</form>\n\t\t";
     $page->add_block(new Block("Report Image", $html, "left"));
 }
Example #12
0
 public function display_new_post_composer(Page $page, $threadID)
 {
     global $config;
     $max_characters = $config->get_int('forumMaxCharsPerPost');
     $html = make_form(make_link("forum/answer"));
     $html .= '<input type="hidden" name="threadID" value="' . $threadID . '" />';
     $html .= "\n\t\t\t\t<table style='width: 500px;'>\n\t\t\t\t\t<tr><td>Message:</td><td><textarea id='message' name='message' ></textarea>\n\t\t\t\t\t<tr><td></td><td><small>Max characters alowed: {$max_characters}.</small></td></tr>\n\t\t\t\t\t</td></tr>";
     $html .= "<tr><td colspan='2'><input type='submit' value='Submit' /></td></tr>\n\t\t\t\t</table>\n\t\t\t\t</form>\n\t\t\t\t";
     $blockTitle = "Answer to this thread";
     $page->add_block(new Block($blockTitle, $html, "main", 130));
 }
Example #13
0
 public function display_form(Page $page)
 {
     global $user;
     $html = "\n\t\t\t" . make_form(make_link("admin_utils")) . "\n\t\t\t\t<select name='action'>\n\t\t\t\t\t<option value='lowercase all tags'>All tags to lowercase</option>\n\t\t\t\t\t<option value='recount tag use'>Recount tag use</option>\n\t\t\t\t\t<option value='purge unused tags'>Purge unused tags</option>\n\t\t\t\t\t<option value='database dump'>Download database contents</option>\n\t\t\t\t\t<!--<option value='convert to innodb'>Convert database to InnoDB (MySQL only)</option>-->\n\t\t\t\t</select>\n\t\t\t\t<input type='submit' value='Go'>\n\t\t\t</form>\n\t\t";
     $page->add_block(new Block("Misc Admin Tools", $html));
     /* First check
     		Requires you to click the checkbox to enable the delete by query form */
     $dbqcheck = "\n\t\t\tif(document.getElementById(&quot;dbqcheck&quot;).checked == false){\n\t\t\t\tdocument.getElementById(&quot;dbqtags&quot;).disabled = true;\n\t\t\t\tdocument.getElementById(&quot;dbqsubmit&quot;).disabled = true;\n\t\t\t}else{\n\t\t\t\tdocument.getElementById(&quot;dbqtags&quot;).disabled = false;\n\t\t\t\tdocument.getElementById(&quot;dbqsubmit&quot;).disabled = false;\n\t\t\t}";
     /* Second check
     		Requires you to confirm the deletion by clicking ok. */
     $html = "\n\t\t\t<script type='text/javascript'>\n\t\t\tfunction checkform(){\n\t\t\t\tif(confirm('Are you sure you wish to delete all images using these tags?')){\n\t\t\t\t\treturn true;\n\t\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t\t</script>" . make_form(make_link("admin_utils"), "post", false, false, "return checkform()") . "\n\t\t\t\t<input type='checkbox' id='dbqcheck' name='action' onclick='{$dbqcheck}'>\n\t\t\t\t<input type='hidden' name='action' value='delete by query'>\n\t\t\t\t<input type='text' id='dbqtags' disabled='true' name='query'>\n\t\t\t\t<input type='submit' id='dbqsubmit' disabled='true' value='Go'>\n\t\t\t</form>\n\t\t";
     $page->add_block(new Block("Delete by Query", $html));
 }
Example #14
0
 public function display_resize_page(Page $page, $image_id)
 {
     global $config;
     $default_width = $config->get_int('resize_default_width');
     $default_height = $config->get_int('resize_default_height');
     $image = Image::by_id($image_id);
     $thumbnail = $this->build_thumb_html($image, null);
     $html = "<div style='clear:both;'></div>\n\t\t\t\t<p>Resize Image ID " . $image_id . "<br>" . $thumbnail . "</p>\n\t\t\t\t<p>Please note: You will have to refresh the image page, or empty your browser cache.</p>\n\t\t\t\t<p>Enter the new size for the image, or leave blank to scale the image automatically.</p><br>" . make_form(make_link('resize/' . $image_id), 'POST', $multipart = True, 'form_resize') . "\n\t\t\t\t<input type='hidden' name='image_id' value='{$image_id}'>\n\t\t\t\t<table id='large_upload_form'>\n\t\t\t\t\t<tr><td>New Width</td><td colspan='3'><input id='resize_width' name='resize_width' type='text' value='" . $default_width . "'></td></tr>\n\t\t\t\t\t<tr><td>New Height</td><td colspan='3'><input id='resize_height' name='resize_height' type='text' value='" . $default_height . "'></td></tr>\n\t\t\t\t\t<tr><td colspan='4'><input id='resizebutton' type='submit' value='Resize'></td></tr>\n\t\t\t\t</table>\n\t\t\t</form>\n\t\t";
     $page->set_title("Resize Image");
     $page->set_heading("Resize Image");
     $page->add_block(new NavBlock());
     $page->add_block(new Block("Resize Image", $html, "main", 20));
 }
Example #15
0
 protected function create_display_html(WikiPage $page)
 {
     $owner = $page->get_owner();
     $tfe = new TextFormattingEvent($page->body);
     send_event($tfe);
     global $user;
     $edit = "<table><tr>";
     $edit .= Wiki::can_edit($user, $page) ? "\n\t\t\t\t<td>" . make_form(make_link("wiki_admin/edit")) . "\n\t\t\t\t\t<input type='hidden' name='title' value='" . html_escape($page->title) . "'>\n\t\t\t\t\t<input type='hidden' name='revision' value='" . int_escape($page->revision) . "'>\n\t\t\t\t\t<input type='submit' value='Edit'>\n\t\t\t\t</form></td>\n\t\t\t" : "";
     if ($user->is_admin()) {
         $edit .= "\n\t\t\t\t<td>" . make_form(make_link("wiki_admin/delete_revision")) . "\n\t\t\t\t\t<input type='hidden' name='title' value='" . html_escape($page->title) . "'>\n\t\t\t\t\t<input type='hidden' name='revision' value='" . int_escape($page->revision) . "'>\n\t\t\t\t\t<input type='submit' value='Delete This Version'>\n\t\t\t\t</form></td>\n\t\t\t\t<td>" . make_form(make_link("wiki_admin/delete_all")) . "\n\t\t\t\t\t<input type='hidden' name='title' value='" . html_escape($page->title) . "'>\n\t\t\t\t\t<input type='submit' value='Delete All'>\n\t\t\t\t</form></td>\n\t\t\t";
     }
     $edit .= "</tr></table>";
     return "\n\t\t\t<div class='wiki-page'>\n\t\t\t{$tfe->formatted}\n\t\t\t<hr>\n\t\t\t<p class='wiki-footer'>\n\t\t\t\tRevision {$page->revision}\n\t\t\t\tby <a href='" . make_link("user/{$owner->name}") . "'>{$owner->name}</a>\n\t\t\t\tat {$page->date}\n\t\t\t\t{$edit}\n\t\t\t</p>\n\t\t\t</div>\n\t\t";
 }
Example #16
0
 public function manageTips($url, $images)
 {
     global $page;
     $select = "<select name='image'><option value=''>- Select Image -</option>";
     foreach ($images as $image) {
         $select .= "<option style='background-image:url(" . $url . $image . "); background-repeat:no-repeat; padding-left:20px;'  value=\"" . $image . "\">" . $image . "</option>\n";
     }
     $select .= "</select>";
     $html = "\n" . make_form(make_link("tips/save")) . "\n<table>\n  <tr>\n    <td>Enable:</td>\n    <td><input name='enable' type='checkbox' value='Y' checked/></td>\n  </tr>\n  <tr>\n    <td>Image:</td>\n    <td>{$select}</td>\n  </tr>\n  <tr>\n    <td>Message:</td>\n    <td><textarea name='text'></textarea></td>\n  </tr>\n  <tr>\n    <td colspan='2'><input type='submit' value='Submit' /></td>\n  </tr>\n</table>\n</form>\n";
     $page->set_title("Tips List");
     $page->set_heading("Tips List");
     $page->add_block(new NavBlock());
     $page->add_block(new Block("Add Tip", $html, "main", 10));
 }
Example #17
0
 public function get_resize_html(Image $image)
 {
     global $config;
     $default_width = $config->get_int('resize_default_width');
     $default_height = $config->get_int('resize_default_height');
     if (!$default_width) {
         $default_width = $image->width;
     }
     if (!$default_height) {
         $default_height = $image->height;
     }
     $html = "\n\t\t\t" . make_form(make_link("resize/{$image->id}"), 'POST') . "\n\t\t\t\t<input type='hidden' name='image_id' value='{$image->id}'>\n\t\t\t\t<input id='original_width'  name='original_width'  type='hidden' value='{$image->width}'>\n\t\t\t\t<input id='original_height' name='original_height' type='hidden' value='{$image->height}'>\n\t\t\t\t<input id='resize_width'  style='width: 70px;' name='resize_width'  type='number' min='1' value='" . $default_width . "'> x\n\t\t\t\t<input id='resize_height' style='width: 70px;' name='resize_height' type='number' min='1' value='" . $default_height . "'>\n\t\t\t\t<br><label><input type='checkbox' id='resize_aspect' name='resize_aspect' style='max-width: 20px;' checked='checked'> Keep Aspect</label>\n\t\t\t\t<br><input id='resizebutton' type='submit' value='Resize'>\n\t\t\t</form>\n\t\t";
     return $html;
 }
Example #18
0
    /**
     * Add a section to the admin page.
     * @param string $validation_msg
     */
    public function display_admin_block($validation_msg = '')
    {
        global $page;
        if (!empty($validation_msg)) {
            $validation_msg = '<br><b>' . $validation_msg . '</b>';
        }
        $html = '
			Revert source changes/edit by a specific IP address or username.
			<br>You can restrict the time frame to revert these edits as well.
			<br>(Date format: 2011-10-23)
			' . $validation_msg . '

			<br><br>' . make_form(make_link("source_history/bulk_revert"), 'POST') . "\n\t\t\t\t<table class='form'>\n\t\t\t\t\t<tr><th>Username</th>        <td><input type='text' name='revert_name' size='15'></td></tr>\n\t\t\t\t\t<tr><th>IP&nbsp;Address</th> <td><input type='text' name='revert_ip' size='15'></td></tr>\n\t\t\t\t\t<tr><th>Date&nbsp;range</th> <td><input type='text' name='revert_date' size='15'></td></tr>\n\t\t\t\t\t<tr><td colspan='2'><input type='submit' value='Revert'></td></tr>\n\t\t\t\t</table>\n\t\t\t</form>\n\t\t";
        $page->add_block(new Block("Mass Source Revert", $html));
    }
Example #19
0
 public function display_bans(Page $page, $bans)
 {
     global $database, $user;
     $h_bans = "";
     $prefix = $database->get_driver_name() == "sqlite" ? "bans." : "";
     foreach ($bans as $ban) {
         $end_human = date('Y-m-d', $ban[$prefix . 'end_timestamp']);
         $h_bans .= "\n\t\t\t\t<tr>\n\t\t\t\t\t<td width='12%'>{$ban[$prefix . 'ip']}</td>\n\t\t\t\t\t<td>{$ban[$prefix . 'reason']}</td>\n\t\t\t\t\t<td width='10%'>{$ban['banner_name']}</td>\n\t\t\t\t\t<td width='10%'>" . substr($ban[$prefix . 'added'], 0, 10) . "</td>\n\t\t\t\t\t<td width='15%'>{$end_human}</td>\n\t\t\t\t\t" . make_form(make_link("ip_ban/remove")) . "\n\t\t\t\t\t<td width='8%'>\n\t\t\t\t\t\t\t<input type='hidden' name='id' value='{$ban[$prefix . 'id']}'>\n\t\t\t\t\t\t\t<input type='submit' value='Remove'>\n\t\t\t\t\t</td>\n\t\t\t\t\t</form>\n\t\t\t\t</tr>\n\t\t\t";
     }
     $html = "\n\t\t\t<a href='" . make_link("ip_ban/list", "all=on") . "'>Show All</a>\n\t\t\t<p><table id='bans' class='sortable zebra'>\n\t\t\t\t<thead><tr><th>IP</th><th>Reason</th><th>By</th><th>From</th><th>Until</th><th>Action</th></tr></thead>\n\t\t\t\t{$h_bans}\n\t\t\t\t<tfoot><tr id='add'>\n\t\t\t\t\t" . make_form(make_link("ip_ban/add")) . "\n\t\t\t\t\t\t<td><input type='text' name='ip' value='" . html_escape(@$_GET['ip']) . "'></td>\n\t\t\t\t\t\t<td><input type='text' name='reason' value='" . html_escape(@$_GET['reason']) . "'></td>\n\t\t\t\t\t\t<td>{$user->name}</td>\n\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t<td><input type='text' name='end' value='" . html_escape(@$_GET['end']) . "'></td>\n\t\t\t\t\t\t<td><input type='submit' value='Ban'></td>\n\t\t\t\t\t</form>\n\t\t\t\t</tr></tfoot>\n\t\t\t</table>\n\t\t";
     $page->set_title("IP Bans");
     $page->set_heading("IP Bans");
     $page->add_block(new NavBlock());
     $page->add_block(new Block("Edit IP Bans", $html));
 }
Example #20
0
 protected function build_info(Image $image, $editor_parts)
 {
     global $user;
     if (count($editor_parts) == 0) {
         return $image->is_locked() ? "<br>[Image Locked]" : "";
     }
     $html = make_form(make_link("post/set")) . "\n\t\t\t\t\t<input type='hidden' name='image_id' value='{$image->id}'>\n\t\t\t\t\t<table style='width: 500px;' class='image_info form'>\n\t\t";
     foreach ($editor_parts as $part) {
         $html .= $part;
     }
     if ((!$image->is_locked() || $user->can("edit_image_lock")) && $user->can("edit_image_tag")) {
         $html .= "\n\t\t\t\t\t\t<tr><td colspan='4'>\n\t\t\t\t\t\t\t<input class='view' type='button' value='Edit' onclick='\$(\".view\").hide(); \$(\".edit\").show();'>\n\t\t\t\t\t\t\t<input class='edit' type='submit' value='Set'>\n\t\t\t\t\t\t</td></tr>\n\t\t\t";
     }
     $html .= "\n\t\t\t\t\t</table>\n\t\t\t\t</form>\n\t\t";
     return $html;
 }
Example #21
0
 private function show_confirm()
 {
     global $page;
     // set vars
     $determined_imgs = $this->determine_images();
     $error = $determined_imgs["error"];
     $images_for_removal = $determined_imgs["images_for_removal"];
     // if there was an error in determine_images()
     if ($error != "") {
         $page->add_block(new Block("Cannot remove images", $error));
         return;
     }
     // generates the image array & places it in $_POST["bulk_remove_images"]
     $_POST["bulk_remove_images"] = $images_for_removal;
     // Display confirmation message
     $html = make_form(make_link("bulk_remove")) . "Are you sure you want to PERMANENTLY remove " . count($images_for_removal) . " images?<br></form>";
     $page->add_block(new Block("Confirm Removal", $html));
 }
Example #22
0
 protected function build_image_editor(Image $image, $editor_parts)
 {
     if (count($editor_parts) == 0) {
         return $image->is_locked() ? "<br>[Image Locked]" : "";
     }
     if (isset($_GET['search'])) {
         $h_query = "search=" . url_escape($_GET['search']);
     } else {
         $h_query = "";
     }
     $html = " (<a href=\"javascript: toggle('imgdata')\">edit info</a>)";
     $html .= "\n\t\t\t<div id='imgdata'>\n\t\t\t\t" . make_form(make_link("post/set")) . "\n\t\t\t\t\t<input type='hidden' name='image_id' value='{$image->id}'>\n\t\t\t\t\t<input type='hidden' name='query' value='{$h_query}'>\n\t\t\t\t\t<table style='width: 500px;'>\n\t\t";
     foreach ($editor_parts as $part) {
         $html .= $part;
     }
     $html .= "\n\t\t\t\t\t\t<tr><td colspan='2'><input type='submit' value='Set'></td></tr>\n\t\t\t\t\t</table>\n\t\t\t\t</form>\n\t\t\t\t<br>\n\t\t\t</div>\n\t\t";
     return $html;
 }
Example #23
0
 public function display_bans(Page $page, $bans)
 {
     global $database, $user;
     $h_bans = "";
     $n = 0;
     $prefix = $database->engine->name == "sqlite" ? "bans." : "";
     $prefix2 = $database->engine->name == "sqlite" ? "users." : "";
     foreach ($bans as $ban) {
         $end_human = date('Y-m-d', $ban[$prefix . 'end_timestamp']);
         $oe = $n++ % 2 == 0 ? "even" : "odd";
         $h_bans .= "\n\t\t\t\t<tr class='{$oe}'>\n\t\t\t\t\t<td width='10%'>{$ban[$prefix . 'ip']}</td>\n\t\t\t\t\t<td>{$ban[$prefix . 'reason']}</td>\n\t\t\t\t\t<td width='10%'>{$ban['banner_name']}</td>\n\t\t\t\t\t<td width='15%'>{$end_human}</td>\n\t\t\t\t\t<td width='10%'>\n\t\t\t\t\t\t" . make_form(make_link("ip_ban/remove")) . "\n\t\t\t\t\t\t\t<input type='hidden' name='id' value='{$ban[$prefix . 'id']}'>\n\t\t\t\t\t\t\t<input type='submit' value='Remove'>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t";
     }
     $html = "\n\t\t\t<script type='text/javascript'>\n\t\t\t\$(document).ready(function() {\n\t\t\t\t\$(\"#bans\").tablesorter();\n\t\t\t});\n\t\t\t</script>\n\t\t\t<a href='" . make_link("ip_ban/list", "all=on") . "'>Show All</a>\n\t\t\t<p><table id='bans' class='zebra'>\n\t\t\t\t<thead><tr><th>IP</th><th>Reason</th><th>By</th><th>Until</th><th>Action</th></tr></thead>\n\t\t\t\t{$h_bans}\n\t\t\t\t<tfoot><tr>\n\t\t\t\t\t" . make_form(make_link("ip_ban/add")) . "\n\t\t\t\t\t\t<td><input type='text' name='ip'></td>\n\t\t\t\t\t\t<td><input type='text' name='reason'></td>\n\t\t\t\t\t\t<td>{$user->name}</td>\n\t\t\t\t\t\t<td><input type='text' name='end'></td>\n\t\t\t\t\t\t<td><input type='submit' value='Ban'></td>\n\t\t\t\t\t</form>\n\t\t\t\t</tr></tfoot>\n\t\t\t</table>\n\t\t";
     $page->set_title("IP Bans");
     $page->set_heading("IP Bans");
     $page->add_block(new NavBlock());
     $page->add_block(new Block("Edit IP Bans", $html));
 }
Example #24
0
 public function display_note_system(Page $page, $image_id, $recovered_notes, $adminOptions)
 {
     $to_json = array();
     foreach ($recovered_notes as $note) {
         $parsedNote = $note["note"];
         $parsedNote = str_replace("\n", "\\n", $parsedNote);
         $parsedNote = str_replace("\r", "\\r", $parsedNote);
         $to_json[] = array('x1' => $note["x1"], 'y1' => $note["y1"], 'height' => $note["height"], 'width' => $note["width"], 'note' => $parsedNote, 'note_id' => $note["id"]);
     }
     $html = "<script type='text/javascript'>";
     $html .= "notes = " . json_encode($to_json);
     $html .= "</script>\n\t\n\t<div id='noteform'>\n\t\t" . make_form(make_link("note/add_note")) . "\n\t\t\t<input type='hidden' name='image_id' value='" . $image_id . "' />\n\t\t\t<input name='note_x1' type='hidden' value='' id='NoteX1' />\n\t\t\t<input name='note_y1' type='hidden' value='' id='NoteY1' />\n\t\t\t<input name='note_height' type='hidden' value='' id='NoteHeight' />\n\t\t\t<input name='note_width' type='hidden' value='' id='NoteWidth' />\n\t\t\t\n\t\t\t<table>\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan='2'>\n\t\t\t\t\t\t<textarea name='note_text' id='NoteNote' ></textarea>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><input type='submit' value='Add Note' /></td>\n\t\t\t\t\t<td><input type='button' value='Cancel' id='cancelnote' /></td>\n\t\t\t  \t</tr>\n\t\t\t</table>\n\t\t\t\n\t\t</form>\n\t</div>\n\t\t<div id='noteEditForm'>\n\t\t\t" . make_form(make_link("note/edit_note")) . "\n\t\t\t\t<input type='hidden' name='image_id' value='" . $image_id . "' />\n\t\t\t\t<input type='hidden' name='note_id' id='EditNoteID' value='' />\n\t\t\t\t<input name='note_x1' type='hidden' value='' id='EditNoteX1' />\n\t\t\t\t<input name='note_y1' type='hidden' value='' id='EditNoteY1' />\n\t\t\t\t<input name='note_height' type='hidden' value='' id='EditNoteHeight' />\n\t\t\t\t<input name='note_width' type='hidden' value='' id='EditNoteWidth' />\n\t\t\t\t<table>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td colspan='2'>\n\t\t\t\t\t\t\t<textarea name='note_text' id='EditNoteNote' ></textarea>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><input type='submit' value='Save Note' /></td>\n\t\t\t\t\t\t<td><input type='button' value='Cancel' id='EditCancelNote' /></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</form>";
     if ($adminOptions) {
         $html .= "\n\t\t\t\t" . make_form(make_link("note/delete_note")) . "\n\t\t\t\t<input type='hidden' name='image_id' value='" . $image_id . "' />\n\t\t\t\t<input type='hidden' name='note_id' value='' id='DeleteNoteNoteID' />\n\t\t\t\t<table>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><input type='submit' value='Delete note' /></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</form>\n";
     }
     $html .= "</div>";
     $page->add_block(new Block(null, $html, "main", 1));
 }
Example #25
0
 public function display_untags(Page $page, $page_number, $page_count, $bans)
 {
     $h_bans = "";
     foreach ($bans as $ban) {
         $h_bans .= "\n\t\t\t\t<tr>\n\t\t\t\t\t" . make_form(make_link("untag/remove")) . "\n\t\t\t\t\t\t<td width='30%'>{$ban['tag']}</td>\n\t\t\t\t\t\t<td>{$ban['redirect']}</td>\n\t\t\t\t\t\t<td width='10%'>\n\t\t\t\t\t\t\t<input type='hidden' name='tag' value='{$ban['tag']}'>\n\t\t\t\t\t\t\t<input type='submit' value='Remove'>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</form>\n\t\t\t\t</tr>\n\t\t\t";
     }
     $html = "\n\t\t\t<table id='image_bans' class='zebra sortable'>\n\t\t\t\t<thead>\n\t\t\t\t\t<th>Tag</th><th>Redirect</th><th>Action</th>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<form action='" . make_link("untag/list/1") . "' method='GET'>\n\t\t\t\t\t\t\t<td><input type='text' name='tag' class='autocomplete_tags' autocomplete='off'></td>\n\t\t\t\t\t\t\t<td><input type='text' name='redirect'></td>\n\t\t\t\t\t\t\t<td><input type='submit' value='Search'></td>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t{$h_bans}\n\t\t\t\t<tfoot><tr>\n\t\t\t\t\t" . make_form(make_link("untag/add")) . "\n\t\t\t\t\t\t<td><input type='text' name='tag' class='autocomplete_tags' autocomplete='off'></td>\n\t\t\t\t\t\t<td><input type='text' name='redirect'></td>\n\t\t\t\t\t\t<td><input type='submit' value='Ban'></td>\n\t\t\t\t\t</form>\n\t\t\t\t</tr></tfoot>\n\t\t\t</table>\n\t\t";
     $prev = $page_number - 1;
     $next = $page_number + 1;
     $h_prev = $page_number <= 1 ? "Prev" : "<a href='" . make_link("untag/list/{$prev}") . "'>Prev</a>";
     $h_index = "<a href='" . make_link() . "'>Index</a>";
     $h_next = $page_number >= $page_count ? "Next" : "<a href='" . make_link("untag/list/{$next}") . "'>Next</a>";
     $nav = "{$h_prev} | {$h_index} | {$h_next}";
     $page->set_title("UnTags");
     $page->set_heading("UnTags");
     $page->add_block(new Block("Edit UnTags", $html));
     $page->add_block(new Block("Navigation", $nav, "left", 0));
     $this->display_paginator($page, "untag/list", null, $page_number, $page_count);
 }
Example #26
0
 public function display_blocks($blocks)
 {
     global $page, $user;
     $html = "<table class='form' style='width: 100%;'>";
     foreach ($blocks as $block) {
         $html .= make_form(make_link("blocks/update"));
         $html .= "<input type='hidden' name='id' value='" . html_escape($block['id']) . "'>";
         $html .= "<tr>";
         $html .= "<th>Title</th><td><input type='text' name='title' value='" . html_escape($block['title']) . "'></td>";
         $html .= "<th>Area</th><td><input type='text' name='area' value='" . html_escape($block['area']) . "'></td>";
         $html .= "<th>Priority</th><td><input type='text' name='priority' value='" . html_escape($block['priority']) . "'></td>";
         $html .= "<th>Pages</th><td><input type='text' name='pages' value='" . html_escape($block['pages']) . "'></td>";
         $html .= "<th>Delete</th><td><input type='checkbox' name='delete'></td>";
         $html .= "<td><input type='submit' value='Save'></td>";
         $html .= "</tr>";
         $html .= "<tr>";
         $html .= "<td colspan='11'><textarea rows='5' name='content'>" . html_escape($block['content']) . "</textarea></td>";
         $html .= "</tr>\n";
         $html .= "<tr>";
         $html .= "<td colspan='11'>&nbsp;</td>";
         $html .= "</tr>\n";
         $html .= "</form>\n";
     }
     $html .= make_form(make_link("blocks/add"));
     $html .= "<tr>";
     $html .= "<th>Title</th><td><input type='text' name='title' value=''></td>";
     $html .= "<th>Area</th><td><select name='area'><option>left<option>main</select></td>";
     $html .= "<th>Priority</th><td><input type='text' name='priority' value='50'></td>";
     $html .= "<th>Pages</th><td><input type='text' name='pages' value='post/list*'></td>";
     $html .= "<td colspan='3'><input type='submit' value='Add'></td>";
     $html .= "</tr>";
     $html .= "<tr>";
     $html .= "<td colspan='11'><textarea rows='5' name='content'></textarea></td>";
     $html .= "</tr>\n";
     $html .= "</form>";
     $html .= "</table>";
     $page->set_title("Blocks");
     $page->set_heading("Blocks");
     $page->add_block(new NavBlock());
     $page->add_block(new Block("Block Editor", $html));
 }
Example #27
0
 public function display_note_system(Page $page, $image_id, $recovered_notes, $adminOptions)
 {
     $html = "<script type='text/javascript'>\n        \n        notes = [";
     foreach ($recovered_notes as $note) {
         $parsedNote = $note["note"];
         $parsedNote = str_replace("\n", "\\n", $parsedNote);
         $parsedNote = str_replace("\r", "\\r", $parsedNote);
         $html .= "{'x1':'" . $note["x1"] . "', " . "'y1':'" . $note["y1"] . "'," . "'height':'" . $note["height"] . "'," . "'width':'" . $note["width"] . "'," . "'note':'" . $parsedNote . "'," . "'note_id':'" . $note["id"] . "'},";
     }
     if (count($recovered_notes) > 0) {
         substr($html, 0, strlen($html) - 1);
         // remove final comma
     }
     $html .= "];\n        ";
     $html .= "\$(document).ready(function() {\n\t\t\t\$('#main_image').imgNotes(); //If your notes data is is not named notes pass it\n \n\t\t\t\$('#cancelnote').click(function(){\n\t\t\t\t\$('#main_image').imgAreaSelect({ hide: true });\n\t\t\t\t\$('#noteform').hide();\n\t\t\t});\n\n                        \$('#EditCancelNote').click(function() {\n                            \$('#main_image').imgAreaSelect({ hide: true });\n                            \$('#noteEditForm').hide();\n                        });\n\n\t\t\t\$('#addnote').click(function(){\n                                \$('#noteEditForm').hide();\n\t\t\t\t\$('#main_image').imgAreaSelect({ onSelectChange: showaddnote, x1: 120, y1: 90, x2: 280, y2: 210 });\n\t\t\t\treturn false;\n\t\t\t});\n\n                        \$('.note').click(function() {\n                                \$('#noteform').hide();\n                                var imgOffset = \$('#main_image').offset();\n\n                                var x1 = parseInt(this.style.left) - imgOffset.left;\n                                var y1 = parseInt(this.style.top) - imgOffset.top;\n                                var width = parseInt(this.style.width);\n                                var height = parseInt(this.style.height);\n                                var text = \$(this).next('.notep').text().replace(/([^>]?)\\n{2}/g, '\$1\\n');\n                                var id = \$(this).next('.notep').next('.noteID').text();\n\n                                \$('#main_image').imgAreaSelect({ onSelectChange: showeditnote, x1: x1, y1: y1, x2: x1 + width, y2: y1 + height });\n                                setEditNoteData(x1, y1, width, height, text, id);\n                        });\n\t\t});\n\t\t\n\tfunction showaddnote (img, area) {\n\t\timgOffset = \$(img).offset();\n\t\tform_left  = parseInt(imgOffset.left) + parseInt(area.x1);\n\t\tform_top   = parseInt(imgOffset.top) + parseInt(area.y1) + parseInt(area.height)+5;\n\n\t\t\$('#noteform').css({ left: form_left + 'px', top: form_top + 'px'});\n\n\t\t\$('#noteform').show();\n\n\t\t\$('#noteform').css('z-index', 10000);\n\t\t\$('#NoteX1').val(area.x1);\n\t\t\$('#NoteY1').val(area.y1);\n\t\t\$('#NoteHeight').val(area.height);\n\t\t\$('#NoteWidth').val(area.width);\n\t}\n        function showeditnote (img, area) {\n            imgOffset = \$(img).offset();\n            form_left  = parseInt(imgOffset.left) + area.x1;\n            form_top   = parseInt(imgOffset.top) + area.y2;\n\n            \$('#noteEditForm').css({ left: form_left + 'px', top: form_top + 'px'});\n\n            \$('#noteEditForm').show();\n\n            \$('#noteEditForm').css('z-index', 10000);\n            \$('#EditNoteX1').val(area.x1);\n            \$('#EditNoteY1').val(area.y1);\n            \$('#EditNoteHeight').val(area.height);\n            \$('#EditNoteWidth').val(area.width);\n        }\n        function setEditNoteData(x1, y1, width, height, text, id)\n        {\n            \$('#EditNoteX1').val(x1);\n            \$('#EditNoteY1').val(y1);\n            \$('#EditNoteHeight').val(height);\n            \$('#EditNoteWidth').val(width);\n            \$('#EditNoteNote').text(text);\n            \$('#EditNoteID').val(id);\n            \$('#DeleteNoteNoteID').val(id);\n        }\n\n\t</script>\n\t\n\t<div id='noteform'>\n\t\t" . make_form(make_link("note/add_note")) . "\n\t\t\t<input type='hidden' name='image_id' value='" . $image_id . "' />\n\t\t\t<input name='note_x1' type='hidden' value='' id='NoteX1' />\n\t\t\t<input name='note_y1' type='hidden' value='' id='NoteY1' />\n\t\t\t<input name='note_height' type='hidden' value='' id='NoteHeight' />\n\t\t\t<input name='note_width' type='hidden' value='' id='NoteWidth' />\n\t\t\t\n\t\t\t<table>\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan='2'>\n\t\t\t\t\t\t<textarea name='note_text' id='NoteNote' ></textarea>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><input type='submit' value='Add Note' /></td>\n\t\t\t\t\t<td><input type='button' value='Cancel' id='cancelnote' /></td>\n\t\t\t  \t</tr>\n\t\t\t</table>\n\t\t\t\n\t\t</form>\n\t</div>\n        <div id='noteEditForm'>\n\t\t\t" . make_form(make_link("note/edit_note")) . "\n                <input type='hidden' name='image_id' value='" . $image_id . "' />\n                <input type='hidden' name='note_id' id='EditNoteID' value='' />\n                <input name='note_x1' type='hidden' value='' id='EditNoteX1' />\n                <input name='note_y1' type='hidden' value='' id='EditNoteY1' />\n                <input name='note_height' type='hidden' value='' id='EditNoteHeight' />\n                <input name='note_width' type='hidden' value='' id='EditNoteWidth' />\n                <table>\n                    <tr>\n                        <td colspan='2'>\n                            <textarea name='note_text' id='EditNoteNote' ></textarea>\n                        </td>\n                    </tr>\n                    <tr>\n                        <td><input type='submit' value='Save Note' /></td>\n                        <td><input type='button' value='Cancel' id='EditCancelNote' /></td>\n                    </tr>\n                </table>\n            </form>";
     if ($adminOptions) {
         $html .= "\n\t\t\t\t" . make_form(make_link("note/delete_note")) . "\n                <input type='hidden' name='image_id' value='" . $image_id . "' />\n                <input type='hidden' name='note_id' value='' id='DeleteNoteNoteID' />\n                <table>\n                    <tr>\n                        <td><input type='submit' value='Delete note' /></td>\n                    </tr>\n                </table>\n            </form>\n";
     }
     $html .= "</div>";
     $page->add_block(new Block(null, $html, "main", 1));
 }
Example #28
0
 public function display_advanced(Page $page, $options)
 {
     $h_rows = "";
     ksort($options);
     foreach ($options as $name => $value) {
         $h_name = html_escape($name);
         $h_value = html_escape($value);
         $h_box = "";
         if (strpos($value, "\n") > 0) {
             $h_box .= "<textarea cols='50' rows='4' name='_config_{$h_name}'>{$h_value}</textarea>";
         } else {
             $h_box .= "<input type='text' name='_config_{$h_name}' value='{$h_value}'>";
         }
         $h_box .= "<input type='hidden' name='_type_{$h_name}' value='string'>";
         $h_rows .= "<tr><td>{$h_name}</td><td>{$h_box}</td></tr>";
     }
     $table = "\n\t\t\t" . make_form(make_link("setup/save")) . "\n\t\t\t\t<table id='settings' class='sortable zebra'>\n\t\t\t\t\t<thead><tr><th width='25%'>Name</th><th>Value</th></tr></thead>\n\t\t\t\t\t<tbody>{$h_rows}</tbody>\n\t\t\t\t\t<tfoot><tr><td colspan='2'><input type='submit' value='Save Settings'></td></tr></tfoot>\n\t\t\t\t</table>\n\t\t\t</form>\n\t\t\t";
     $page->set_title("Shimmie Setup");
     $page->set_heading("Shimmie Setup");
     $page->add_block(new Block("Navigation", $this->build_navigation(), "left", 0));
     $page->add_block(new Block("Setup", $table));
 }
Example #29
0
 public function display_global_page(Page $page, $history)
 {
     $start_string = "\n\t\t\t<div style='text-align: left'>\n\t\t\t\t" . make_form(make_link("tag_history/revert")) . "\n\t\t\t\t\t<ul style='list-style-type:none;'>\n\t\t";
     $end_string = "\n\t\t\t\t\t</ul>\n\t\t\t\t\t<input type='submit' value='Revert'>\n\t\t\t\t</form>\n\t\t\t</div>\n\t\t";
     global $user;
     $history_list = "";
     foreach ($history as $fields) {
         $current_id = $fields['id'];
         $image_id = $fields['image_id'];
         $current_tags = html_escape($fields['tags']);
         $name = $fields['name'];
         $setter = "<a href='" . make_link("user/" . url_escape($name)) . "'>" . html_escape($name) . "</a>";
         if ($user->is_admin()) {
             $setter .= " / " . $fields['user_ip'];
         }
         $history_list .= "\n\t\t\t\t<li>\n\t\t\t\t\t<input type='radio' name='revert' value='{$current_id}'>\n\t\t\t\t\t<a href='" . make_link("post/view/{$image_id}") . "'>{$image_id}</a>:\n\t\t\t\t\t{$current_tags} (Set by {$setter})\n\t\t\t\t</li>\n\t\t\t";
     }
     $history_html = $start_string . $history_list . $end_string;
     $page->set_title("Global Tag History");
     $page->set_heading("Global Tag History");
     $page->add_block(new NavBlock());
     $page->add_block(new Block("Tag History", $history_html, "main", 10));
 }
Example #30
0
 /**
  * Display link to replace the image
  *
  * @param $image_id integer The image to replace
  * @return string
  */
 public function get_replace_html($image_id)
 {
     $html = make_form(make_link("image/replace")) . "\n\t\t\t\t\t<input type='hidden' name='image_id' value='{$image_id}' />\n\t\t\t\t\t<input type='submit' value='Replace' />\n\t\t\t\t</form>";
     return $html;
 }