Changing images to posts
This commit is contained in:
parent
8d34fc360c
commit
cb81e46f9e
4 changed files with 7 additions and 7 deletions
|
@ -5,7 +5,7 @@ class FeaturedInfo extends ExtensionInfo
|
|||
public const KEY = "featured";
|
||||
|
||||
public $key = self::KEY;
|
||||
public $name = "Featured Image";
|
||||
public $name = "Featured Post";
|
||||
public $url = self::SHIMMIE_URL;
|
||||
public $authors = self::SHISH_AUTHOR;
|
||||
public $license = self::LICENSE_GPLV2;
|
||||
|
@ -15,9 +15,9 @@ class FeaturedInfo extends ExtensionInfo
|
|||
to the other image control buttons (delete, rotate, etc).
|
||||
Clicking it will set the image as the site's current feature,
|
||||
which will be shown in the side bar of the post list.
|
||||
<p><b>Viewing a featured image</b>
|
||||
<p><b>Viewing a featured post</b>
|
||||
<br>Visit <code>/featured_image/view</code>
|
||||
<p><b>Downloading a featured image</b>
|
||||
<p><b>Downloading a featured post</b>
|
||||
<br>Link to <code>/featured_image/download</code>. This will give
|
||||
the raw data for an image (no HTML). This is useful so that you
|
||||
can set your desktop wallpaper to be the download URL, refreshed
|
||||
|
|
|
@ -20,7 +20,7 @@ class Featured extends Extension
|
|||
$id = int_escape($_POST['image_id']);
|
||||
if ($id > 0) {
|
||||
$config->set_int("featured_id", $id);
|
||||
log_info("featured", "Featured image set to >>$id", "Featured image set");
|
||||
log_info("featured", "Featured post set to >>$id", "Featured post set");
|
||||
$page->set_mode(PageMode::REDIRECT);
|
||||
$page->set_redirect(make_link("post/view/$id"));
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ class FeaturedTest extends ShimmiePHPUnitTestCase
|
|||
$config->set_int("featured_id", $image_id);
|
||||
|
||||
$this->get_page("post/list");
|
||||
$this->assert_text("Featured Image");
|
||||
$this->assert_text("Featured Post");
|
||||
|
||||
# FIXME: test changing from one feature to another
|
||||
|
||||
|
@ -31,6 +31,6 @@ class FeaturedTest extends ShimmiePHPUnitTestCase
|
|||
// after deletion, there should be no feature
|
||||
$this->delete_image($image_id);
|
||||
$this->get_page("post/list");
|
||||
$this->assert_no_text("Featured Image");
|
||||
$this->assert_no_text("Featured Post");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ class FeaturedTheme extends Themelet
|
|||
{
|
||||
public function display_featured(Page $page, Image $image): void
|
||||
{
|
||||
$page->add_block(new Block("Featured Image", $this->build_featured_html($image), "left", 3));
|
||||
$page->add_block(new Block("Featured Post", $this->build_featured_html($image), "left", 3));
|
||||
}
|
||||
|
||||
public function get_buttons_html(int $image_id): string
|
||||
|
|
Reference in a new issue