kronolith's tag actions to require POST for state changing actions.
Horde::addInlineScript($js, 'dom');
}
- public function handle($args)
+ public function handle($args, $post)
{
include_once dirname(__FILE__) . '/../../base.php';
Horde::addInlineScript($js, 'dom');
}
- function handle($args)
+ function handle($args, $post)
{
include_once dirname(__FILE__) . '/../../base.php';
*
* @param array $args Arguments for this view.
*/
- public function handle($args)
+ public function handle($args, $post)
{
include_once dirname(__FILE__) . '/../../base.php';
Horde::addInlineScript($js, 'dom');
}
- public function handle($args)
+ public function handle($args, $post)
{
include_once dirname(__FILE__) . '/../../base.php';
if (empty($args['input'])) {
return $this->_getUrl('ImageSaveGeotag', 'ansel');
}
- public function handle($args)
+ public function handle($args, $post)
{
include_once dirname(__FILE__) . '/../../base.php';
return $ret;
}
- public function handle($args)
+ public function handle($args, $post)
{
include_once dirname(__FILE__) . '/../../base.php';
Horde::addInlineScript($js, 'dom');
}
- public function handle($args)
+ public function handle($args, $post)
{
include_once dirname(__FILE__) . '/../../base.php';
Horde::addInlineScript($js, 'dom');
}
- public function handle($args)
+ public function handle($args, $post)
{
if (empty($args['input'])) {
return 0;
Horde::addInlineScript($js, 'dom');
}
- public function handle($args)
+ public function handle($args, $post)
{
if (empty($args['input'])) {
return 0;
*
* @return array The data to send to the autocompleter JS code.
*/
- public function handle($args)
+ public function handle($args, $post)
{
// Avoid errors if 'input' isn't set and short-circuit empty searches.
if (empty($args['input']) ||
function addTag(resource, type, endpoint)
{
if (!$('newtags-input_' + resource).value.blank()) {
- var params = new Object();
- params.imple="/action=add/resource=" + resource + "/type=" + type + "/tags=" + $('newtags-input_' + resource).value;
+ var params = { "params": "resource=" + resource + "/type=" + type + "/tags=" + $('newtags-input_' + resource).value };
new Ajax.Updater({success:'tags_' + resource},
- endpoint,
+ endpoint + "/action=add/post=params",
{
method: 'post',
parameters: params,
function removeTag(resource, type, tagid, endpoint)
{
- var params = new Object();
- params.imple = "/action=remove/resource=" + resource + "/type=" + type + "/tags=" + tagid;
+ var params = {"params": "resource=" + resource + "/type=" + type + "/tags=" + tagid };
new Ajax.Updater({success:'tags_' + resource},
- endpoint,
+ endpoint + "/action=remove/post=params",
{
method: 'post',
parameters: params
*
* @return string TODO
*/
- public function handle($args)
+ public function handle($args, $post)
{
// Avoid errors if 'input' isn't set and short-circuit empty searches.
if (empty($args['input']) ||
*
* @param array $args Arguments for this view.
*/
- public function handle($args)
+ public function handle($args, $post)
{
/* First, determine the type of view we are asking for */
$view = $args['view'];
* the type of object (event/calendar) and 'tags' should be the integer
* tag_id of the tag to remove.
*/
- public function handle($args)
+ public function handle($args, $post)
{
+ require_once dirname(__FILE__) . '/../../base.php';
global $ansel_storage;
$request = $args['action'];
- $content = array('id' => $args['resource'], 'type' => $args['type']);
- $tags = $args['tags'];
+ $content = array('id' => $post['resource'], 'type' => $post['type']);
+ $tags = $post['tags'];
// Check perms
- if ($args['type'] == 'calendar') {
- $cal = $GLOBALS['kronolith_shares']->getShare($args['resource']);
+ if ($post['type'] == 'calendar') {
+ $cal = $GLOBALS['kronolith_shares']->getShare($post['resource']);
$perm = $cal->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT);
- } elseif($args['type'] == 'event') {
- $event = Kronolith::getDriver()->getByUID($args['resource']);
+ } elseif($post['type'] == 'event') {
+ $event = Kronolith::getDriver()->getByUID($post['resource']);
$perm = $event->hasPermission(PERMS_EDIT, Horde_Auth::getAuth());
}
$tagger = Kronolith::getTagger();
switch ($request) {
case 'add':
- $tagger->tag($args['resource'], $tags, $args['type']);
+ $tagger->tag($post['resource'], $tags, $post['type']);
break;
case 'remove':
- $tagger->untag($args['resource'], (int)$tags, $args['type']);
+ $tagger->untag($post['resource'], (int)$tags, $post['type']);
break;
}
}
- return $this->_getTagHtml($tagger, $args['resource'], $args['type']);
+ return $this->_getTagHtml($tagger, $post['resource'], $post['type']);
}
*
* @return string TODO
*/
- public function handle($args)
+ public function handle($args, $post)
{
// Avoid errors if 'input' isn't set and short-circuit empty searches.
if (empty($args['input']) ||