/** * Get methods * * @return array */ public function getMethods() { $methods = array_flip(SproutSeo_RedirectMethods::getConstants()); $newMethods = array(); foreach ($methods as $key => $value) { $newMethods[$key] = $key . ' - ' . $value; } return $newMethods; }
/** * @param BaseElementModel $element * @param string $attribute * * @return string */ public function getTableAttributeHtml(BaseElementModel $element, $attribute) { switch ($attribute) { case 'method': $method = $element->{$attribute}; //Get method options $methods = array_flip(SproutSeo_RedirectMethods::getConstants()); return $method . ' - ' . $methods[$method]; case 'test': // Send link for testing $link = "<a href='{$element->oldUrl}' target='_blank' class='go'>Test</a>"; if ($element->regex) { $link = " - "; } return $link; default: return parent::getTableAttributeHtml($element, $attribute); break; } }