More linting!
This commit is contained in:
parent
022c162f40
commit
e37c5cb9d0
@ -58,6 +58,9 @@ class Image {
|
||||
/** @var string */
|
||||
public $ext;
|
||||
|
||||
/** @var string[]|null */
|
||||
public $tag_array;
|
||||
|
||||
public $owner_id, $owner_ip;
|
||||
public $posted, $posted_timestamp;
|
||||
public $source;
|
||||
|
@ -9,9 +9,19 @@
|
||||
*
|
||||
*/
|
||||
class AuthorSetEvent extends Event {
|
||||
var $image, $user, $author;
|
||||
/** @var \Image */
|
||||
public $image;
|
||||
/** @var \User */
|
||||
public $user;
|
||||
/** @var string */
|
||||
public $author;
|
||||
|
||||
public function __construct(Image $image, User $user, /*string*/ $author)
|
||||
/**
|
||||
* @param Image $image
|
||||
* @param User $user
|
||||
* @param string $author
|
||||
*/
|
||||
public function __construct(Image $image, User $user, /*string*/ $author)
|
||||
{
|
||||
$this->image = $image;
|
||||
$this->user = $user;
|
||||
@ -937,9 +947,12 @@ class Artists extends Extension {
|
||||
return $result;
|
||||
}
|
||||
|
||||
/*
|
||||
* HERE WE GET THE ID OF THE ARTIST
|
||||
*/
|
||||
/**
|
||||
* HERE WE GET THE ID OF THE ARTIST.
|
||||
*
|
||||
* @param string $name
|
||||
* @return string|int
|
||||
*/
|
||||
private function get_artist_id($name){
|
||||
global $database;
|
||||
$artistID = $database->get_row("SELECT id FROM artists WHERE name = ?"
|
||||
@ -1203,7 +1216,8 @@ class Artists extends Extension {
|
||||
/*
|
||||
* HERE WE GET THE INFO OF THE ALIAS
|
||||
*/
|
||||
private function get_alias($artistID){
|
||||
private function get_alias($artistID)
|
||||
{
|
||||
if (!is_numeric($artistID)) return;
|
||||
|
||||
global $database;
|
||||
|
@ -12,8 +12,12 @@
|
||||
* activated; new config options are in $_POST
|
||||
*/
|
||||
class ConfigSaveEvent extends Event {
|
||||
var $config;
|
||||
/** @var \Config */
|
||||
public $config;
|
||||
|
||||
/**
|
||||
* @param Config $config
|
||||
*/
|
||||
public function __construct(Config $config) {
|
||||
$this->config = $config;
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ class _SafeImage {
|
||||
$this->posted = $img->posted_timestamp;
|
||||
$this->source = $img->source;
|
||||
$this->owner_id = $img->owner_id;
|
||||
$this->tags = $img->tag_array;
|
||||
$this->tags = $img->get_tag_array();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -122,15 +122,15 @@ class TagEditCloud extends Extension {
|
||||
$size = sprintf("%.2f", max($row['scaled'],0.5));
|
||||
$js = htmlspecialchars('tageditcloud_toggle_tag(this,'.json_encode($full_tag).')',ENT_QUOTES); //Ugly, but it works
|
||||
|
||||
if(array_search($row['tag'],$image->tag_array) !== FALSE) {
|
||||
if(array_search($row['tag'],$image->get_tag_array()) !== FALSE) {
|
||||
if($used_first) {
|
||||
$precloud .= " <span onclick='$js' class='tag-selected' style='font-size: ${size}em$color' title='${row['count']}'>$h_tag</span> \n";
|
||||
$precloud .= " <span onclick='{$js}' class='tag-selected' style='font-size: ${size}em$color' title='${row['count']}'>{$h_tag}</span> \n";
|
||||
continue;
|
||||
} else {
|
||||
$entry = " <span onclick='$js' class='tag-selected' style='font-size: ${size}em$color' title='${row['count']}'>$h_tag</span> \n";
|
||||
$entry = " <span onclick='{$js}' class='tag-selected' style='font-size: ${size}em$color' title='${row['count']}'>{$h_tag}</span> \n";
|
||||
}
|
||||
} else {
|
||||
$entry = " <span onclick='$js' style='font-size: ${size}em$color' title='${row['count']}'>$h_tag</span> \n";
|
||||
$entry = " <span onclick='{$js}' style='font-size: ${size}em$color' title='${row['count']}'>{$h_tag}</span> \n";
|
||||
}
|
||||
|
||||
if($counter++ <= $def_count) {
|
||||
@ -141,21 +141,21 @@ class TagEditCloud extends Extension {
|
||||
}
|
||||
|
||||
if($precloud != '') {
|
||||
$html .= "<div id='tagcloud_set'>$precloud</div>";
|
||||
$html .= "<div id='tagcloud_set'>{$precloud}</div>";
|
||||
}
|
||||
|
||||
if($postcloud != '') {
|
||||
$postcloud = "<div id='tagcloud_extra' style='display: none;'>$postcloud</div>";
|
||||
$postcloud = "<div id='tagcloud_extra' style='display: none;'>{$postcloud}</div>";
|
||||
}
|
||||
|
||||
$html .= "<div id='tagcloud_unset'>$cloud$postcloud</div>";
|
||||
$html .= "<div id='tagcloud_unset'>{$cloud}{$postcloud}</div>";
|
||||
|
||||
if($sort_method != 'a' && $counter > $def_count) {
|
||||
$rem = $counter - $def_count;
|
||||
$html .= "</div><br>[<span onclick='tageditcloud_toggle_extra(this);' style='color: #0000EF; font-weight:bold;'>show $rem more tags</span>]";
|
||||
$html .= "</div><br>[<span onclick='tageditcloud_toggle_extra(this);' style='color: #0000EF; font-weight:bold;'>show {$rem} more tags</span>]";
|
||||
}
|
||||
|
||||
return "<div id='tageditcloud' class='tageditcloud'>$html</div>"; // FIXME: stupidasallhell
|
||||
return "<div id='tageditcloud' class='tageditcloud'>{$html}</div>"; // FIXME: stupidasallhell
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -347,7 +347,7 @@ class Tag_History extends Extension {
|
||||
* This function is called just before an images tag are changed.
|
||||
*
|
||||
* @param Image $image
|
||||
* @param null|string|string[] $tags
|
||||
* @param string|string[] $tags
|
||||
*/
|
||||
private function add_tag_history(Image $image, $tags) {
|
||||
global $database, $config, $user;
|
||||
@ -355,7 +355,7 @@ class Tag_History extends Extension {
|
||||
$new_tags = Tag::implode($tags);
|
||||
$old_tags = Tag::implode($image->get_tag_array());
|
||||
|
||||
if($new_tags == $old_tags) return;
|
||||
if($new_tags == $old_tags) { return; }
|
||||
|
||||
if(empty($old_tags)) {
|
||||
/* no old tags, so we are probably adding the image for the first time */
|
||||
@ -366,7 +366,7 @@ class Tag_History extends Extension {
|
||||
}
|
||||
|
||||
$allowed = $config->get_int("history_limit");
|
||||
if($allowed == 0) return;
|
||||
if($allowed == 0) { return; }
|
||||
|
||||
// if the image has no history, make one with the old tags
|
||||
$entries = $database->get_one("SELECT COUNT(*) FROM tag_histories WHERE image_id = ?", array($image->id));
|
||||
@ -386,7 +386,7 @@ class Tag_History extends Extension {
|
||||
$entries++;
|
||||
|
||||
// if needed remove oldest one
|
||||
if($allowed == -1) return;
|
||||
if($allowed == -1) { return; }
|
||||
if($entries > $allowed) {
|
||||
// TODO: Make these queries better
|
||||
/*
|
||||
|
@ -376,7 +376,6 @@ class Upload extends Extension {
|
||||
"No data found -- perhaps the site has hotlink protection?");
|
||||
$ok = false;
|
||||
}else{
|
||||
global $user;
|
||||
$pathinfo = pathinfo($url);
|
||||
$metadata = array();
|
||||
$metadata['filename'] = $filename;
|
||||
|
Loading…
x
Reference in New Issue
Block a user