/** * Drunique content safety helper * * Arguments can be used with %s to pass in replace variables * * @param $title * @param $data * @param null $args * @return string */ public static function content($title, $data, $args = null) { if (empty($title)) { return ''; } $arguments = func_get_args(); if (!empty($data) && !empty($data[$title]) && !empty($data[$title]['content'])) { return htmlspecialchars_decode(DruniqueAPI::parse($data[$title]['content'], array_slice($arguments, 2))); } else { return $title; } }
public function kudos_faq($title, $index, $args = null) { $kudos_faq; if (empty($title)) { $kudos_faq = ''; } $viewVars = $this->_View->viewVars; if (array_key_exists('kudos_faq', $viewVars)) { $data = $viewVars['kudos_faq']; } else { $data = null; } if (!empty($data) && !empty($data[$title]) && !empty($data[$title]['kudos faq'][0])) { $kudos_faq = $data[$title]['kudos faq']; } else { $kudos_faq = $title; } if (!empty($kudos_faq) && isset($kudos_faq[$index])) { $kudos_faq = $kudos_faq[$index]; } else { if (!empty($data)) { DruniqueAPI::log_error($data, $title); } return $title; } $arguments = func_get_args(); return htmlspecialchars_decode(DruniqueAPI::parse($kudos_faq, array_slice($arguments, 3))); }