Example #1
0
 /**
  * Gather a list of mime that must be treated specially. Used for dynamic replacement in XML mainly.
  * @static
  * @param string $keyword "editable", "image", "audio", "zip"
  * @return string
  */
 public static function getAjxpMimes($keyword)
 {
     if ($keyword == "editable") {
         // Gather editors!
         $pServ = AJXP_PluginsService::getInstance();
         $plugs = $pServ->getPluginsByType("editor");
         //$plugin = new AJXP_Plugin();
         $mimes = array();
         foreach ($plugs as $plugin) {
             $node = $plugin->getManifestRawContent("/editor/@mimes", "node");
             $openable = $plugin->getManifestRawContent("/editor/@openable", "node");
             if ($openable->item(0) && $openable->item(0)->value == "true" && $node->item(0)) {
                 $mimestring = $node->item(0)->value;
                 $mimesplit = explode(",", $mimestring);
                 foreach ($mimesplit as $value) {
                     $mimes[$value] = $value;
                 }
             }
         }
         return implode(",", array_values($mimes));
     } else {
         if ($keyword == "image") {
             return "png,bmp,jpg,jpeg,gif";
         } else {
             if ($keyword == "audio") {
                 return "mp3";
             } else {
                 if ($keyword == "zip") {
                     if (ConfService::zipBrowsingEnabled()) {
                         return "zip,ajxp_browsable_archive";
                     } else {
                         return "none_allowed";
                     }
                 }
             }
         }
     }
     return "";
 }
 public function computeBootConf()
 {
     if (isset($_GET["server_prefix_uri"])) {
         $_SESSION["AJXP_SERVER_PREFIX_URI"] = str_replace("_UP_", "..", $_GET["server_prefix_uri"]);
     }
     $currentIsMinisite = strpos(session_name(), "AjaXplorer_Shared") === 0;
     $config = array();
     $config["ajxpResourcesFolder"] = "plugins/gui.ajax/res";
     if ($currentIsMinisite) {
         $config["ajxpServerAccess"] = "index_shared.php";
     } else {
         $config["ajxpServerAccess"] = AJXP_SERVER_ACCESS;
     }
     $config["zipEnabled"] = ConfService::zipBrowsingEnabled();
     $config["multipleFilesDownloadEnabled"] = ConfService::zipCreationEnabled();
     $customIcon = $this->getFilteredOption("CUSTOM_ICON");
     self::filterXml($customIcon);
     $config["customWording"] = array("welcomeMessage" => $this->getFilteredOption("CUSTOM_WELCOME_MESSAGE"), "title" => ConfService::getCoreConf("APPLICATION_TITLE"), "icon" => $customIcon, "iconWidth" => $this->getFilteredOption("CUSTOM_ICON_WIDTH"), "iconHeight" => $this->getFilteredOption("CUSTOM_ICON_HEIGHT"), "iconOnly" => $this->getFilteredOption("CUSTOM_ICON_ONLY"), "titleFontSize" => $this->getFilteredOption("CUSTOM_FONT_SIZE"));
     $cIcBin = $this->getFilteredOption("CUSTOM_ICON_BINARY");
     if (!empty($cIcBin)) {
         $config["customWording"]["icon_binary_url"] = "get_action=get_global_binary_param&binary_id=" . $cIcBin;
     }
     $config["usersEnabled"] = AuthService::usersEnabled();
     $config["loggedUser"] = AuthService::getLoggedUser() != null;
     $config["currentLanguage"] = ConfService::getLanguage();
     $config["session_timeout"] = intval(ini_get("session.gc_maxlifetime"));
     $timeoutTime = $this->getFilteredOption("CLIENT_TIMEOUT_TIME");
     if (empty($timeoutTime)) {
         $to = $config["session_timeout"];
     } else {
         $to = $timeoutTime;
     }
     if ($currentIsMinisite) {
         $to = -1;
     }
     $config["client_timeout"] = intval($to);
     $config["client_timeout_warning"] = floatval($this->getFilteredOption("CLIENT_TIMEOUT_WARN"));
     $config["availableLanguages"] = ConfService::getConf("AVAILABLE_LANG");
     $config["usersEditable"] = ConfService::getAuthDriverImpl()->usersEditable();
     $config["ajxpVersion"] = AJXP_VERSION;
     $config["ajxpVersionDate"] = AJXP_VERSION_DATE;
     $analytic = $this->getFilteredOption('GOOGLE_ANALYTICS_ID');
     if (!empty($analytic)) {
         $config["googleAnalyticsData"] = array("id" => $analytic, "domain" => $this->getFilteredOption('GOOGLE_ANALYTICS_DOMAIN'), "event" => $this->getFilteredOption('GOOGLE_ANALYTICS_EVENT'));
     }
     $config["i18nMessages"] = ConfService::getMessages();
     $config["SECURE_TOKEN"] = AuthService::generateSecureToken();
     $config["streaming_supported"] = "true";
     $config["theme"] = $this->pluginConf["GUI_THEME"];
     return $config;
 }