/**
  * Constructor
  *
  * @access	public
  * @param	object		Registry reference
  * @return	void
  */
 public function __construct(ipsRegistry $registry)
 {
     //-----------------------------------------
     // Make shortcuts
     //-----------------------------------------
     $this->registry = $registry;
     $this->DB = $registry->DB();
     $this->settings = $registry->fetchSettings();
     $this->member = $registry->member();
     $this->cache = $registry->cache();
     $this->caches =& $registry->cache()->fetchCaches();
     $this->request = $registry->fetchRequest();
     $this->lang = $registry->class_localization;
     if (IN_ACP) {
         //-----------------------------------------
         // Load HTML
         //-----------------------------------------
         $this->html = $this->registry->output->loadTemplate('cp_skin_blocks_feed');
         //-----------------------------------------
         // Set up stuff
         //-----------------------------------------
         $this->form_code = $this->html->form_code = 'module=blocks&section=wizard';
         $this->form_code_js = $this->html->form_code_js = 'module=blocks&section=wizard';
     }
     //-----------------------------------------
     // Get interface
     //-----------------------------------------
     require_once IPSLib::getAppDir('ccs') . '/sources/blocks/feed/feedInterface.php';
 }
 /**
  * Constructor
  *
  * @access	public
  * @param	object		Registry reference
  * @return	void
  */
 public function __construct(ipsRegistry $registry)
 {
     //-----------------------------------------
     // Make shortcuts
     //-----------------------------------------
     $this->registry = $registry;
     $this->DB = $registry->DB();
     $this->settings = $registry->fetchSettings();
     $this->member = $registry->member();
     $this->cache = $registry->cache();
     $this->caches =& $registry->cache()->fetchCaches();
     $this->request = $registry->fetchRequest();
     $this->lang = $registry->class_localization;
     if (IN_ACP) {
         //-----------------------------------------
         // Load HTML
         //-----------------------------------------
         $this->html = $this->registry->output->loadTemplate('cp_skin_blocks_custom');
         //-----------------------------------------
         // Set up stuff
         //-----------------------------------------
         $this->form_code = $this->html->form_code = 'module=blocks&section=wizard';
         $this->form_code_js = $this->html->form_code_js = 'module=blocks&section=wizard';
     }
 }
 /**
  * Constructor
  *
  * @access	public
  * @param	object		Registry reference
  * @return	void
  */
 public function __construct(ipsRegistry $registry)
 {
     //-----------------------------------------
     // Make shortcuts
     //-----------------------------------------
     $this->registry = $registry;
     $this->DB = $registry->DB();
     $this->settings = $registry->fetchSettings();
     $this->member = $registry->member();
     $this->cache = $registry->cache();
     $this->caches =& $registry->cache()->fetchCaches();
     $this->request = $registry->fetchRequest();
     $this->lang = $registry->class_localization;
 }
 /**
  * Constructor
  * 
  * @access	public
  * @param	string	[$lang]		Language file to load, english by default
  * @return	void
  */
 public function __construct(ipsRegistry $registry)
 {
     /* Make objects */
     $this->DB = $registry->DB();
     $this->settings = $registry->fetchSettings();
     $this->member = $registry->member();
     $this->cache = $registry->cache();
     $this->caches =& $registry->cache()->fetchCaches();
     $this->request = $registry->fetchRequest();
     $this->memberData =& $registry->member()->fetchMemberData();
     /* Rebuild the cache if needed */
     if (!$this->caches['lang_data']) {
         $this->rebuildLanguagesCache();
     }
     /* Find the lang we need */
     if ($this->caches['lang_data']) {
         foreach ($this->caches['lang_data'] as $_lang) {
             $this->languages[] = $_lang;
             if ($_lang['lang_default']) {
                 $this->local = $_lang['lang_short'];
                 $this->lang_id = $_lang['lang_id'];
                 $this->language_dir = $_lang['lang_id'];
                 /* Guests get the default */
                 if (!$this->memberData['member_id']) {
                     $this->member->language_id = $this->lang_id;
                 }
             }
         }
     }
     /* Got a guest cookie? */
     if (!$this->memberData['member_id']) {
         $langCookie = IPSCookie::get('language');
         if ($langCookie) {
             $this->member->language_id = trim(IPSText::parseCleanValue($langCookie));
         }
     }
     /* Forcing Engrish? */
     if ($forceCookie = IPSCookie::get('forceEnglish')) {
         if ($forceCookie) {
             $this->_forceEnglish = true;
         }
     }
     //-----------------------------------------
     // Time options
     //-----------------------------------------
     /* 	%b is month abbr
     			%B is full month
     			%d is date 01-31
     			%Y is 4 digit year
     			%g is 2 digit year
     			%I is hour 01-12
     			%H - hour as a decimal number using a 24-hour clock (range 00 to 23) 
     			%M is min 01-59
     			%p is am/pm */
     $this->time_options = array('JOINED' => $this->settings['clock_joined'] ? $this->settings['clock_joined'] : '%d-%B %y', 'SHORT' => $this->settings['clock_short'] ? $this->settings['clock_short'] : '%b %d %Y %I:%M %p', 'LONG' => $this->settings['clock_long'] ? $this->settings['clock_long'] : '%d %B %Y - %I:%M %p', 'TINY' => $this->settings['clock_tiny'] ? $this->settings['clock_tiny'] : '%d %b %Y - %H:%M', 'DATE' => $this->settings['clock_date'] ? $this->settings['clock_date'] : '%d %b %Y', 'TIME' => 'h:i A', 'ACP' => '%d %B %Y, %H:%M', 'ACP2' => '%d %B %Y, %H:%M');
     //--------------------------------
     // Did we choose a language?
     //--------------------------------
     if (isset($this->request['setlanguage']) and $this->request['setlanguage'] and $this->request['langid']) {
         /* Forcing english? */
         if ($this->request['langid'] == '__english__') {
             IPSDebug::addMessage("forceEnglish cookie written");
             IPSCookie::set('forceEnglish', 1, 0);
             $this->_forceEnglish = true;
         } else {
             if ($this->request['k'] == $this->member->form_hash and is_array(ipsRegistry::cache()->getCache('lang_data')) and count(ipsRegistry::cache()->getCache('lang_data'))) {
                 foreach (ipsRegistry::cache()->getCache('lang_data') as $data) {
                     if ($data['lang_id'] == $this->request['langid']) {
                         if ($this->memberData['member_id']) {
                             IPSMember::save($this->memberData['member_id'], array('core' => array('language' => $data['lang_id'])));
                         } else {
                             IPSCookie::set('language', $data['lang_id']);
                         }
                         $this->member->language_id = $data['lang_id'];
                         $this->member->setProperty('language', $data['lang_id']);
                         break;
                     }
                 }
             }
         }
     }
     //--------------------------------
     // Now set it
     //--------------------------------
     if ($this->member->language_id) {
         foreach ($this->caches['lang_data'] as $_lang) {
             if ($_lang['lang_id'] == $this->member->language_id) {
                 $this->local = $_lang['lang_short'];
                 $this->lang_id = $_lang['lang_id'];
                 $this->language_dir = $_lang['lang_id'];
                 break;
             }
         }
     }
     //-----------------------------------------
     // Set locale
     //-----------------------------------------
     setlocale(LC_ALL, $this->local);
     $this->local_data = localeconv();
     //-----------------------------------------
     // Using in_dev override
     //-----------------------------------------
     if (IN_DEV and !$this->_forceEnglish) {
         if (is_dir(IPS_CACHE_PATH . 'cache/lang_cache/master_lang')) {
             $this->lang_id = 'master_lang';
         }
     }
 }