Fix Button, ConfirmDeletePage, WarningDialog templates
This commit is contained in:
parent
0325a2ec90
commit
01822cdccf
@ -39,7 +39,7 @@ class ViewPhoto extends HTMLController
|
|||||||
$page = new ConfirmDeletePage($photo->getImage());
|
$page = new ConfirmDeletePage($photo->getImage());
|
||||||
$this->page->adopt($page);
|
$this->page->adopt($page);
|
||||||
}
|
}
|
||||||
else if (isset($_REQUEST['delete_confirmed']))
|
elseif (isset($_REQUEST['delete_confirmed']))
|
||||||
{
|
{
|
||||||
$album_url = $photo->getSubdir();
|
$album_url = $photo->getSubdir();
|
||||||
$photo->delete();
|
$photo->delete();
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* Kabuki CMS (C) 2013-2015, Aaron van Geffen
|
* Kabuki CMS (C) 2013-2015, Aaron van Geffen
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
class Button extends SubTemplate
|
class Button extends Template
|
||||||
{
|
{
|
||||||
private $content = '';
|
private $content = '';
|
||||||
private $href = '';
|
private $href = '';
|
||||||
@ -19,7 +19,7 @@ class Button extends SubTemplate
|
|||||||
$this->class = $class;
|
$this->class = $class;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function html_content()
|
public function html_main()
|
||||||
{
|
{
|
||||||
echo '
|
echo '
|
||||||
<a class="', $this->class, '" href="', $this->href, '">', $this->content, '</a>';
|
<a class="', $this->class, '" href="', $this->href, '">', $this->content, '</a>';
|
||||||
|
@ -13,7 +13,7 @@ class ConfirmDeletePage extends PhotoPage
|
|||||||
parent::__construct($photo);
|
parent::__construct($photo);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function html_content()
|
public function html_main()
|
||||||
{
|
{
|
||||||
$this->confirm();
|
$this->confirm();
|
||||||
$this->photo();
|
$this->photo();
|
||||||
@ -22,7 +22,7 @@ class ConfirmDeletePage extends PhotoPage
|
|||||||
private function confirm()
|
private function confirm()
|
||||||
{
|
{
|
||||||
$buttons = [];
|
$buttons = [];
|
||||||
$buttons[] = new Button("Delete", BASEURL . '/' . $this->photo->getSlug() . '?delete_confirmed', "btn btn-red");
|
$buttons[] = new Button("Delete", BASEURL . '/' . $this->photo->getSlug() . '/?delete_confirmed', "btn btn-danger");
|
||||||
$buttons[] = new Button("Cancel", $this->photo->getPageUrl(), "btn");
|
$buttons[] = new Button("Cancel", $this->photo->getPageUrl(), "btn");
|
||||||
|
|
||||||
$alert = new WarningDialog(
|
$alert = new WarningDialog(
|
||||||
@ -30,6 +30,6 @@ class ConfirmDeletePage extends PhotoPage
|
|||||||
"You are about to permanently delete the following photo.",
|
"You are about to permanently delete the following photo.",
|
||||||
$buttons
|
$buttons
|
||||||
);
|
);
|
||||||
$alert->html_content();
|
$alert->html_main();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -251,7 +251,7 @@ class PhotoPage extends Template
|
|||||||
<div id="user_actions_box" class="content-box">
|
<div id="user_actions_box" class="content-box">
|
||||||
<h3>Actions</h3>
|
<h3>Actions</h3>
|
||||||
<a class="btn btn-primary" href="', BASEURL, '/editasset/?id=', $this->photo->getId(), '">Edit photo</a>
|
<a class="btn btn-primary" href="', BASEURL, '/editasset/?id=', $this->photo->getId(), '">Edit photo</a>
|
||||||
<a class="btn btn-danger" href="', BASEURL, '/', $this->photo->getSlug(), '?confirm_delete">Delete photo</a>
|
<a class="btn btn-danger" href="', BASEURL, '/', $this->photo->getSlug(), '/?confirm_delete">Delete photo</a>
|
||||||
</div>';
|
</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,6 @@ class WarningDialog extends Alert
|
|||||||
private function addButtons()
|
private function addButtons()
|
||||||
{
|
{
|
||||||
foreach ($this->buttons as $button)
|
foreach ($this->buttons as $button)
|
||||||
$button->html_content();
|
$button->html_main();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user