-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprettyphoto.plugin.php
41 lines (34 loc) · 1.42 KB
/
prettyphoto.plugin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
/**
* Create a block with arbitrary content.
*
*/
class PrettyPhoto extends Plugin
{
public function configure()
{
$form = new FormUI(__CLASS__);
$form->append('checkbox', 'hide_social', __CLASS__ . 'hide_social', _t('Hide social area in fullsize image view', __CLASS__));
$form->append('submit', 'submit', _t('Save'));
return $form;
}
public function action_template_header($theme)
{
Plugins::act('add_prettyphoto_template');
}
public function action_add_prettyphoto_template()
{
$social_string = (Options::get(__CLASS__ . 'hide_social', false)) ? "{social_tools:false}" : "";
Stack::add( 'template_header_javascript', Site::get_url('vendor') . '/jquery.js', 'jquery' );
Stack::add( 'template_stylesheet', array($this->get_url() . '/css/prettyPhoto.css', 'screen' ) );
Stack::add( 'template_header_javascript', $this->get_url() . '/js/jquery.prettyPhoto.js', 'prettyphoto', 'jquery' );
$init_string = "$(document).ready(function(){ $(\"a[rel^='prettyPhoto']\").prettyPhoto(" . $social_string . ");});";
Stack::add( 'template_header_javascript', $init_string, 'prettyphoto_init', 'prettyphoto' );
}
public function action_add_prettyphoto_admin()
{
Stack::add('admin_stylesheet', array($this->get_url() . '/css/prettyPhoto.css', 'screen'));
Stack::add('admin_header_javascript', $this->get_url() . '/js/jquery.prettyPhoto.js', 'prettyphoto', 'jquery');
}
}
?>