本文整理汇总了PHP中Ansel::initJSVariables方法的典型用法代码示例。如果您正苦于以下问题:PHP Ansel::initJSVariables方法的具体用法?PHP Ansel::initJSVariables怎么用?PHP Ansel::initJSVariables使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ansel
的用法示例。
在下文中一共展示了Ansel::initJSVariables方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Initialize the view. Needs the following parameters:
* <pre>
* 'browse_button' - Dom id of button to open file system browser.
* 'target' - Url of the target page to upload images to.
* 'drop_target' - Dom id of the element to receive drag and drop images
* (If runtime supports it).
* 'gallery' - The gallery id we are uploading to.
* </pre>
* @param <type> $params
*/
public function __construct(array $params = array())
{
$this->_params = $params;
$this->_gallery = $this->_params['gallery'];
if (!empty($params['forceNoScript'])) {
$this->_forceNoScript = true;
}
Ansel::initJSVariables();
global $page_output;
$page_output->addScriptFile('scriptaculous/effects.js', 'horde');
$page_output->addScriptFile('carousel.js');
}
示例2: catch
/*
* All parameters get passed into the View via a $params array so we can
* pass the same parameters easily via API calls.
*/
$params['page'] = Horde_Util::getFormData('page', 0);
$params['sort'] = Horde_Util::getFormData('sort');
$params['sort_dir'] = Horde_Util::getFormData('sort_dir', 0);
$params['year'] = Horde_Util::getFormData('year', 0);
$params['month'] = Horde_Util::getFormData('month', 0);
$params['day'] = Horde_Util::getFormData('day', 0);
$params['view'] = $viewname;
$params['gallery_view'] = Horde_Util::getFormData('gallery_view');
$params['gallery_id'] = Horde_Util::getFormData('gallery');
$params['gallery_slug'] = Horde_Util::getFormData('slug');
$params['force_grouping'] = Horde_Util::getFormData('force_grouping');
$params['image_id'] = Horde_Util::getFormData('image');
try {
$view = new $view($params);
} catch (Horde_Exception $e) {
$page_output->header();
$notification->notify(array('listeners' => 'status'));
echo '<br /><em>' . htmlspecialchars($e->getMessage()) . '</em>';
$page_output->footer();
exit;
}
Ansel::initJSVariables();
$page_output->growler = true;
$page_output->header(array('title' => $view->getTitle(), 'ajax' => true));
$notification->notify(array('listeners' => 'status'));
echo $view->html();
$page_output->footer();