Example #1
0
 /**
  * Hosting quota in bytes
  * 
  * @return int
  */
 public function getQuota()
 {
     //get hosting quota
     $quota = (int) $this->_application->get_settings('hosting_quota');
     if (!isset($quota) || $quota <= 0) {
         //10MB gratis
         $quota = 10 * 1024 * 1024;
     }
     return $quota;
 }
 /**
  * Get Google Search code
  *
  * @param Application_Model_Application $app
  */
 public function GoogleSearchCode($app, $ReturnCss = true)
 {
     $gsSettings = $app->get_settings('gsc');
     $html = '';
     if (!isset($gsSettings) || $gsSettings['cx'] == '' || !isset($gsSettings['active']) || $gsSettings['active'] == false) {
         return '';
     }
     if ($ReturnCss) {
         echo $this->prepareCss($gsSettings);
     }
     $html = "\n            <div id='search'>\n                <script>\n                (function() {\n                    var cx = '" . $gsSettings['cx'] . "';\n                    var gcse = document.createElement('script');\n                    gcse.type = 'text/javascript';\n                    gcse.async = true;\n                    gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +\n                        '//www.google.com/cse/cse.js?cx=' + cx;\n                    var s = document.getElementsByTagName('script')[0];\n                    s.parentNode.insertBefore(gcse, s);\n                })();\n                </script>\n            \n            ";
     $html .= "<gcse:searchbox-only " . "resultsUrl='" . $this->view->serverUrl() . "/" . $this->view->currLang . "/search' " . "lr='lang_" . $this->view->currLang . "' enableAutoComplete='true'>" . "</gcse:searchbox-only>\n</div>";
     $html .= "<span id='searchToggle' class='fa fa-search'></span>";
     echo $html;
 }
Example #3
0
 /**
  * Init theme view script paths
  * 
  * @return mixed
  */
 public function _initTheme()
 {
     if (null != $this->_application->get_settings('theme')) {
         $this->_theme = $this->_application->get_settings('theme');
     } else {
         //no theme defined
         return;
     }
     /**
      * create symlink if it's not exist
      */
     $createSml = $this->getRequest()->getParam('csl', 'no');
     if ($createSml == 'yes') {
         $target = APPLICATION_PATH . '/../themes/' . $this->_theme . '/public';
         $symlink = $this->_publicDirectory . '/themes/' . $this->_theme;
         if (!is_link($symlink) && !is_dir($symlink)) {
             symlink($target, $symlink);
         }
         foreach (glob(APPLICATION_PATH . '/modules/*', GLOB_ONLYDIR) as $module_path) {
             $module_name = str_replace(APPLICATION_PATH . '/modules/', '', $module_path);
             $target = $module_path . '/public';
             $symlink = $this->_publicDirectory . '/modules/' . $module_name;
             if (!is_link($symlink) && !is_dir($symlink)) {
                 symlink($target, $symlink);
             }
         }
     }
     $this->view->theme = $this->_theme;
     $themePath = APPLICATION_PATH . '/../themes/' . $this->_theme . '/views/';
     //add theme view path for cms module
     $this->view->addScriptPath($themePath . 'cms');
     //add theme view path for current module
     $this->view->addScriptPath($themePath . $this->getRequest()->getModuleName());
     //add original layout path to view scripts path
     $this->view->addScriptPath($this->_helper->layout->getLayoutPath());
     //add theme layout path
     $this->_helper->layout->setLayoutPath(APPLICATION_PATH . '/../themes/' . $this->_theme . '/layouts');
     //add theme view helpers path
     $this->view->addHelperPath(APPLICATION_PATH . '/../themes/' . $this->_theme . '/helpers', 'Theme_View_Helper');
 }