Exemple #1
0
 protected function _init()
 {
     $this->driver = Beatnik_Driver::factory();
     // Get a list of domains to work with
     $this->domains = $this->driver->getDomains();
     // Jump to new domain
     if (Horde_Util::getFormData('curdomain') !== null && !empty($this->domains)) {
         try {
             $domain = $this->driver->getDomain(Horde_Util::getFormData('curdomain'));
         } catch (Exception $e) {
             $GLOBALS['notification']->push($e->getMessage(), 'horde.error');
             $domain = $domains[0];
         }
         $_SESSION['beatnik']['curdomain'] = $domain;
     }
     // Determine if the user should see basic or advanced options
     if (!isset($_SESSION['beatnik']['expertmode'])) {
         $_SESSION['beatnik']['expertmode'] = false;
     } elseif (Horde_Util::getFormData('expertmode') == 'toggle') {
         if ($_SESSION['beatnik']['expertmode']) {
             $GLOBALS['notification']->push(_("Expert Mode off"), 'horde.message');
             $_SESSION['beatnik']['expertmode'] = false;
         } else {
             $GLOBALS['notification']->push(_("Expert Mode ON"), 'horde.warning');
             $_SESSION['beatnik']['expertmode'] = true;
         }
     }
     // Initialize the page marker
     if (!isset($_SESSION['beatnik']['curpage'])) {
         $_SESSION['beatnik']['curpage'] = 0;
     }
 }
Exemple #2
0
 /**
  * Constructs a new Beatnik DB driver object.
  *
  * @param array  $params    A hash containing connection parameters.
  */
 function __construct($params = array())
 {
     $params = array_merge(array('domains_table' => 'domains', 'records_table' => 'records'), $params);
     parent::__construct($params);
 }
Exemple #3
0
 /**
  * Constructs a new Beatnik DB driver object.
  *
  * @param array  $params    A hash containing connection parameters.
  */
 function Beatnik_Driver_sql($params = array())
 {
     parent::Beatnik_Driver($params);
     $this->_connect();
 }