Skip to content

Commit

Permalink
Merge pull request #9 from low/master
Browse files Browse the repository at this point in the history
Improved LV3 compatibility
  • Loading branch information
elivz committed Oct 23, 2015
2 parents 9ee6501 + 895f6c2 commit 3ce3ec7
Showing 1 changed file with 16 additions and 27 deletions.
43 changes: 16 additions & 27 deletions ee3/vz_url/ft.vz_url.php
Expand Up @@ -36,7 +36,7 @@ public function __construct()
*/
public function accepts_content_type($name)
{
return ($name == 'channel' || $name == 'grid');
return in_array($name, array('channel', 'grid', 'low_variables'));
}


Expand Down Expand Up @@ -120,22 +120,6 @@ public function grid_display_settings($settings)
);
}

/**
* Display Low Variable Settings
*/
public function var_display_settings($settings)
{
$show_redirects = isset($settings['show_redirects']) && $settings['show_redirects'] == 'y';

return array(
array(
lang('vz_url_show_redirects_label'),
form_checkbox('variable_settings[vz_url][show_redirects]', 'y', $show_redirects)
)
);
}


// --------------------------------------------------------------------


Expand All @@ -149,6 +133,15 @@ public function save_settings($settings)
);
}

/**
* Save var Settings
*/
public function var_save_settings($settings)
{
return array(
'show_redirects' => ee('Request')->post('show_redirects')
);
}

// --------------------------------------------------------------------

Expand Down Expand Up @@ -188,7 +181,7 @@ public function grid_display_field($data)
}

/**
* Display Low Variable
* Display Low Variable (required for now)
*/
public function var_display_field($data)
{
Expand Down Expand Up @@ -231,14 +224,6 @@ public function save($data)
return ($data == 'http://' || $data == 'https://') ? '' : $data;
}

/**
* Save Low Variable
*/
public function var_save_field($data)
{
return $this->save($data);
}


// --------------------------------------------------------------------

Expand Down Expand Up @@ -325,6 +310,10 @@ public function replace_redirect($data, $params=array(), $tagdata=FALSE)
*/
public function var_replace_tag($data, $params=array(), $tagdata=FALSE)
{
return $this->replace_tag($data, $params, $tagdata);
$method = 'replace_' . (isset($params['modifier']) ? $params['modifier'] : 'tag');

return (method_exists($this, $method))
? $this->$method($data, $params, $tagdata)
: FALSE;
}
}

0 comments on commit 3ce3ec7

Please sign in to comment.