/**
  * Returns instance of Tinebase_Config
  *
  * @return Tinebase_Config
  */
 public static function getInstance()
 {
     if (self::$_instance === NULL) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
 /**
  * testInternalAddressbookConfig
  * 
  * @see http://forge.tine20.org/mantisbt/view.php?id=5846
  */
 public function testInternalAddressbookConfig()
 {
     $list = $this->objects['initialList'];
     $list->container_id = NULL;
     $listBackend = new Addressbook_Backend_List();
     $listBackend->update($list);
     Admin_Config::getInstance()->delete(Tinebase_Config::APPDEFAULTS);
     $list = Addressbook_Controller_List::getInstance()->addListMember($list, $this->objects['contact1']);
     $appConfigDefaults = Admin_Controller::getInstance()->getConfigSettings();
     $this->assertTrue(!empty($appConfigDefaults[Admin_Model_Config::DEFAULTINTERNALADDRESSBOOK]), print_r($appConfigDefaults, TRUE));
 }
Пример #3
0
 require_once 'ushop/params/information.php';
 $form->addElement('html', '</div></div>');
 $form->addElement('html', '<div id="configuration" class="morphtabs_panel"><div class="panel_content">');
 require_once 'ushop/params/global.php';
 require_once 'ushop/params/paypal.php';
 $form->addElement('html', '</div></div>');
 $form->addElement('html', '<div id="display" class="morphtabs_panel"><div class="panel_content">');
 require_once 'ushop/params/frontend_display.php';
 require_once 'ushop/params/admin_display.php';
 $form->addElement('html', '</div></div>');
 if ($form->validate()) {
     $menuBar = array();
     // Apply form element filters.
     $form->freeze();
     $values = $form->process(array(&$this, 'formValues'));
     $ushop_ini = new Admin_Config($this->registry, array('path' => $this->registry->ini_dir . '/ushop.ini.php'));
     if ($values['information']) {
         $ftp = new File_FTP($this->registry);
         foreach ($values['information'] as $key => $value) {
             $message = file_put_contents($_SERVER['DOCUMENT_ROOT'] . '/tmp/' . $key . '.html', stripslashes(str_replace('\\r\\n', '', $value)));
             $ftp->put($_SERVER['DOCUMENT_ROOT'] . '/tmp/' . $key . '.html', $ftp->public_html . '/' . $this->registry->get('settings.resolve') . '/file/' . $key . '.html', true);
             unlink($_SERVER['DOCUMENT_ROOT'] . '/tmp/' . $key . '.html');
         }
         unset($values['information']);
         $ftp->disconnect();
     }
     foreach ($values as $section => $value) {
         foreach ($value as $key => $value) {
             $ushop_ini->set($key, $value, $section);
         }
     }
 /**
  * set default internal addressbook
  * 
  * @param Tinebase_Model_Container $internalAddressbook
  * @return Tinebase_Model_Container
  * 
  * @todo create new internal adb on the fly if it does not exist?
  */
 public static function setDefaultInternalAddressbook($internalAddressbook = NULL)
 {
     if ($internalAddressbook === NULL) {
         $internalAddressbook = Tinebase_Container::getInstance()->getContainerByName('Addressbook', 'Internal Contacts', Tinebase_Model_Container::TYPE_SHARED);
     }
     Admin_Config::getInstance()->set(Tinebase_Config::APPDEFAULTS, array(Admin_Model_Config::DEFAULTINTERNALADDRESSBOOK => $internalAddressbook->getId()));
     return $internalAddressbook;
 }
Пример #5
0
             if ($fileinfo->isDir()) {
                 $templates[$fileinfo->getFilename()] = $path . '/' . $fileinfo->getFilename();
             }
         }
     }
     unset($iterator);
 }
 ksort($templates);
 if (isset($_POST['template'])) {
     $template = $templates[$_POST['template']];
     $template_name = $_POST['template'];
 } else {
     $template = $templates[$this->registry->admin_config->get('admin_template', 'SERVER')];
     $template_name = $this->registry->admin_config->get('admin_template', 'SERVER');
 }
 $template_files = new Admin_Config($this->registry, array('path' => $template . '/ini/template.ini.php'));
 $template_files->public_html = true;
 //print_rr($template_files);
 if (isset($_POST['files'])) {
     $c = 0;
     $ini = array('cache' => $template_files->get('cache'), 'css' => $template_files->get('css'), 'js_ini_files' => $template_files->get('js_ini_files'));
     $template_files->removeAllSections();
     foreach ($ini as $section => $value) {
         foreach ($value as $key => $value) {
             $template_files->set($key, $value, $section);
         }
     }
     foreach ($_POST['files'] as $file) {
         $file = split('/', $file);
         $files[$file[1]][] = $file[2];
         $template_files->set($c, '/Common/javascript/Source/' . $file[0] . '/' . $file[1] . '/' . $file[2], 'mootools_js');