get() public static méthode

Get all categories.
public static get ( )
Exemple #1
0
 /**
  */
 public function update(Horde_Core_Prefs_Ui $ui)
 {
     global $page_output;
     $cManager = new Horde_Prefs_CategoryManager();
     /* Always save colors of all categories. */
     $colors = array();
     $categories = $cManager->get();
     foreach ($categories as $category) {
         if ($color = $ui->vars->get('color_' . hash('md5', $category))) {
             $colors[$category] = $color;
         }
     }
     if ($color = $ui->vars->get('color_' . hash('md5', '_default_'))) {
         $colors['_default_'] = $color;
     }
     if ($color = $ui->vars->get('color_' . hash('md5', '_unfiled_'))) {
         $colors['_unfiled_'] = $color;
     }
     $cManager->setColors($colors);
     switch ($ui->vars->cAction) {
         case 'add':
             $cManager->add($ui->vars->category);
             break;
         case 'remove':
             $cManager->remove($ui->vars->category);
             break;
         default:
             /* Save button. */
             $page_output->addInlineScript(array('if (window.opener && window.name) window.close();'));
             return true;
     }
     return false;
 }
Exemple #2
0
/**
 * Copyright 2005-2014 Horde LLC (http://www.horde.org/)
 *
 * See the enclosed file COPYING for license information (GPL). If you
 * did not receive this file, see http://www.horde.org/licenses/gpl.
 *
 * @author Ben Klang <*****@*****.**>
 */
require_once __DIR__ . '/lib/Application.php';
$beatnik = Horde_Registry::appInit('beatnik');
// Unset the current domain since we are generating a zone list
$_SESSION['beatnik']['curdomain'] = null;
// Set up categories
$cManager = new Horde_Prefs_CategoryManager();
$categories = $cManager->get();
$colors = $cManager->colors();
$fgcolors = $cManager->fgColors();
// Page results
// Check for and store the current page in the session
$page = Horde_Util::getGet('page', $_SESSION['beatnik']['curpage']);
$_SESSION['beatnik']['curpage'] = $page;
// Create the Pager UI
$pager_vars = Horde_Variables::getDefaultVariables();
$pager_vars->set('page', $page);
$perpage = $prefs->getValue('domains_perpage');
$pager = new Horde_Core_Ui_Pager('page', $pager_vars, array('num' => count($beatnik->domains), 'url' => 'listzones.php', 'page_count' => 10, 'perpage' => $perpage));
// Limit the domain list to the current page
$domains = array_slice($beatnik->domains, $page * $perpage, $perpage);
// Hide fields that the user does not want to see
$fields = Beatnik::getRecFields('soa');