Exemple #1
0
 public static function disabled($name, $preferences)
 {
     $content = tr('Plugin <strong>%0</strong> cannot be executed.', $name);
     if (Perms::get()->admin) {
         global $smarty;
         $smarty->loadPlugin('smarty_function_preference');
         $smarty->loadPlugin('smarty_modifier_escape');
         $content .= '<form method="post" action="tiki-admin.php">';
         foreach ($preferences as $pref) {
             $content .= smarty_function_preference(array('name' => $pref), $smarty);
         }
         $content .= '<input type="submit" value="' . smarty_modifier_escape(tra('Set')) . '"/>';
         $content .= '</form>';
     }
     return self::error(tra('Plugin disabled'), $content);
 }
Exemple #2
0
 public static function disabled($name, $preferences)
 {
     $content = tr('Plugin <strong>%0</strong> cannot be executed.', $name);
     if (Perms::get()->admin) {
         $smarty = TikiLib::lib('smarty');
         $smarty->loadPlugin('smarty_function_preference');
         $smarty->loadPlugin('smarty_modifier_escape');
         $content .= '<form method="post" action="tiki-admin.php">';
         foreach ($preferences as $pref) {
             $content .= smarty_function_preference(array('name' => $pref), $smarty);
         }
         $check = key_get(null, null, null, false);
         $content .= '<input type="hidden" name="ticket" value="' . $check['ticket'] . '">';
         $content .= '<input type="submit" class="btn btn-default btn-sm" value="' . smarty_modifier_escape(tra('Set')) . '">';
         $content .= '</form>';
     }
     return self::error(tra('Plugin disabled'), $content);
 }
$maxRecords = $prefs['maxRecords'];
$offset = isset($_REQUEST['offset']) ? $_REQUEST['offset'] : 0;
$smarty->assign('offset', $offset);
$smarty->assign('count', $tikilib->getOne('SELECT COUNT(*) FROM tiki_perspectives'));
$perspectives = $perspectivelib->list_perspectives($offset, $maxRecords);
if ($selectedId) {
    $info = $perspectivelib->get_perspective($selectedId);
    $smarty->assign('perspective_info', $info);
    if (isset($_REQUEST['criteria'])) {
        $prefslib = TikiLib::lib('prefs');
        require_once 'lib/smarty_tiki/function.preference.php';
        $criteria = $_REQUEST['criteria'];
        $results = $prefslib->getMatchingPreferences($criteria);
        $results = array_diff($results, array_keys($info['preferences']));
        foreach ($results as $name) {
            echo smarty_function_preference(array('name' => $name), $smarty);
        }
        exit;
    }
}
$headerlib->add_cssfile('themes/base_files/feature_css/admin.css');
// to display the prefs properly
$headtitle = tra('Perspectives');
$description = tra('Edit Perspectives');
$crumbs[] = new Breadcrumb($headtitle, $description, '', '', '');
$headtitle = breadcrumb_buildHeadTitle($crumbs);
$smarty->assign('headtitle', $headtitle);
$smarty->assign('trail', $crumbs);
if (!isset($cookietab)) {
    $cookietab = '1';
}