1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10:
11: class Ansel_Ajax_Imple_ToggleGalleryActions extends Horde_Core_Ajax_Imple
12: {
13: public function attach()
14: {
15:
16: Horde::addScriptFile('togglewidget.js');
17:
18: $url = $this->_getUrl('ToggleGalleryActions', 'ansel', array('post' => 'value', 'sessionWrite' => true));
19:
20: $js = array();
21: $js[] = "Ansel.widgets['galleryActions'] = {'bindTo': '" . $this->_params['bindTo'] . "', 'url': '" . $url . "'}";
22: $js[] = "Event.observe(Ansel.widgets.galleryActions.bindTo + '-toggle', 'click', function(event) {doActionToggle('" . $this->_params['bindTo'] . "', 'galleryActions'); Event.stop(event)});";
23:
24: Horde::addInlineScript($js, 'dom');
25: }
26:
27: public function handle($args, $post)
28: {
29: if (!isset($post['value'])) {
30: return 0;
31: }
32: $GLOBALS['prefs']->setValue('show_actions', $post['value']);
33:
34: return 1;
35: }
36:
37: }
38: