Exemplo n.º 1
0
 public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
 {
     global $user;
     if ($user->can("delete_image")) {
         $event->add_part($this->theme->get_buttons_html($event->image->id));
     }
 }
Exemplo n.º 2
0
 public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
 {
     global $user, $config;
     if ($user->is_admin() && $config->get_bool("rotate_enabled")) {
         /* Add a link to rotate the image */
         $event->add_part($this->theme->get_rotate_html($event->image->id));
     }
 }
Exemplo n.º 3
0
 public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
 {
     global $database, $user;
     if (!$user->is_anonymous()) {
         $user_id = $user->id;
         $image_id = $event->image->id;
         $is_favorited = $database->get_one("SELECT COUNT(*) AS ct FROM user_favorites WHERE user_id = :user_id AND image_id = :image_id", array("user_id" => $user_id, "image_id" => $image_id)) > 0;
         $event->add_part($this->theme->get_voter_html($event->image, $is_favorited));
     }
 }
Exemplo n.º 4
0
 public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
 {
     $event->add_part("\n\t\t\t<form action='" . make_link("source_history/{$event->image->id}") . "' method='GET'>\n\t\t\t\t<input type='submit' value='View Source History'>\n\t\t\t</form>\n\t\t", 20);
 }
Exemplo n.º 5
0
 public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
 {
     global $config, $database, $user;
     if ($config->get_bool("poolsAdderOnViewImage") && !$user->is_anonymous()) {
         if ($user->is_admin()) {
             $pools = $database->get_all("SELECT * FROM pools");
         } else {
             $pools = $database->get_all("SELECT * FROM pools WHERE user_id=:id", array("id" => $user->id));
         }
         if (count($pools) > 0) {
             $event->add_part($this->theme->get_adder_html($event->image, $pools));
         }
     }
 }
Exemplo n.º 6
0
 public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
 {
     global $user;
     if (!$user->is_anonymous()) {
         $event->add_part($this->theme->note_button($event->image->id));
         $event->add_part($this->theme->request_button($event->image->id));
         if ($user->is_admin()) {
             $event->add_part($this->theme->nuke_notes_button($event->image->id));
             $event->add_part($this->theme->nuke_requests_button($event->image->id));
         }
     }
 }
Exemplo n.º 7
0
 /**
  * @param ImageAdminBlockBuildingEvent $event
  */
 public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
 {
     $event->add_part("\n\t\t\t<form>\n\t\t\t\t<select class='shm-zoomer'>\n\t\t\t\t\t<option value='full'>Full Size</option>\n\t\t\t\t\t<option value='width'>Fit Width</option>\n\t\t\t\t\t<option value='height'>Fit Height</option>\n\t\t\t\t\t<option value='both'>Fit Both</option>\n\t\t\t\t</select>\n\t\t\t</form>\n\t\t", 20);
     $u_ilink = $event->image->get_image_link();
     $nu_enabled = strpos($u_ilink, '?') !== false ? "<input type='hidden' name='q' value='image/{$event->image->id}.{$event->image->ext}' />" : "";
     $event->add_part("\n\t\t\t<form action='{$u_ilink}'>\n\t\t\t\t{$nu_enabled}\n\t\t\t\t<input type='submit' value='Image Only'>\n\t\t\t</form>\n\t\t", 21);
 }
Exemplo n.º 8
0
 public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
 {
     global $user;
     if ($user->can("delete_image")) {
         $event->add_part($this->theme->get_deleter_html($event->image->id));
     }
     /* In the future, could perhaps allow users to replace images that they own as well... */
     if ($user->can("replace_image")) {
         $event->add_part($this->theme->get_replace_html($event->image->id));
     }
 }
Exemplo n.º 9
0
 public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
 {
     global $user;
     if ($user->is_admin()) {
         $event->add_part($this->theme->get_buttons_html($event->image));
     }
 }