public function initMeta($accessDriver) { $this->accessDriver = $accessDriver; if (!function_exists("exif_read_data")) { return; } $messages = ConfService::getMessages(); $def = $this->getMetaDefinition(); if (!count($def)) { return; } $cdataHead = '<div> <div class="panelHeader infoPanelGroup" colspan="2">' . $messages["meta.exif.1"] . '</div> <table class="infoPanelTable" cellspacing="0" border="0" cellpadding="0">'; $cdataFoot = '</table></div>'; $cdataParts = ""; foreach ($def as $key => $label) { $trClass = $even ? " class=\"even\"" : ""; $even = !$even; $cdataParts .= '<tr' . $trClass . '><td class="infoPanelLabel">' . $label . '</td><td class="infoPanelValue" id="ip_' . $key . '">#{' . $key . '}</td></tr>'; } $selection = $this->xPath->query('registry_contributions/client_configs/component_config[@className="InfoPanel"]/infoPanelExtension'); $contrib = $selection->item(0); $contrib->setAttribute("attributes", implode(",", array_keys($def))); $contrib->setAttribute("modifier", "ExifCellRenderer.prototype.infoPanelModifier"); $htmlSel = $this->xPath->query('html', $contrib); $html = $htmlSel->item(0); $cdata = $this->manifestDoc->createCDATASection($cdataHead . $cdataParts . $cdataFoot); $html->appendChild($cdata); parent::init($this->options); }
function init($options) { parent::init($options); $pServ = AJXP_PluginsService::getInstance(); $aPlugs = $pServ->getActivePlugins(); $accessPlugs = $pServ->getPluginsByType("access"); $this->repository = ConfService::getRepository(); foreach ($accessPlugs as $pId => $plug) { if (array_key_exists("access." . $pId, $aPlugs) && $aPlugs["access." . $pId] === true) { $this->accessDriver = $plug; if (!isset($this->accessDriver->repository)) { $this->accessDriver->init($this->repository); $this->accessDriver->initRepository(); $wrapperData = $this->accessDriver->detectStreamWrapper(true); } else { $wrapperData = $this->accessDriver->detectStreamWrapper(false); } $this->urlBase = $wrapperData["protocol"] . "://" . $this->repository->getId(); } } $this->metaStore = AJXP_PluginsService::getInstance()->getUniqueActivePluginForType("metastore"); if ($this->metaStore !== false) { $this->metaStore->initMeta($this->accessDriver); } }
public function init($options) { parent::init($options); $this->useQueue = $this->pluginConf["USE_QUEUE"]; try { $this->msgExchanger = ConfService::instanciatePluginFromGlobalParams($this->pluginConf["UNIQUE_MS_INSTANCE"], "AJXP_MessageExchanger"); } catch (Exception $e) { } }
public function init($options) { parent::init($options); self::$globalOptions = $this->pluginConf; $this->pluginInstance = ConfService::instanciatePluginFromGlobalParams($this->pluginConf["UNIQUE_PLUGIN_INSTANCE"], "AbstractLogDriver"); if ($this->pluginInstance != false) { AJXP_PluginsService::getInstance()->setPluginUniqueActiveForType("log", $this->pluginInstance->getName(), $this->pluginInstance); } self::$loggerInstance = $this->pluginInstance; }
public function init($options) { parent::init($options); $u = AuthService::getLoggedUser(); if ($u == null) { return; } if ($u->getGroupPath() != "/") { $this->enabled = false; } }
public function init($options) { parent::init($options); $this->userId = AuthService::getLoggedUser() !== null ? AuthService::getLoggedUser()->getId() : "shared"; try { $this->eventStore = ConfService::instanciatePluginFromGlobalParams($this->pluginConf["UNIQUE_FEED_INSTANCE"], "AJXP_FeedStore"); } catch (Exception $e) { } if ($this->eventStore === false) { $this->pluginConf["USER_EVENTS"] = false; } }
public function init($options) { parent::init($options); if (AJXP_SERVER_DEBUG) { $this->mailCache = $this->getPluginWorkDir(true) . "/mailbox"; } $pConf = $this->pluginConf["UNIQUE_MAILER_INSTANCE"]; if (!empty($pConf)) { $p = ConfService::instanciatePluginFromGlobalParams($pConf, "AjxpMailer"); AJXP_PluginsService::getInstance()->setPluginUniqueActiveForType($p->getType(), $p->getName(), $p); } }
/** * AJXP_Plugin initializer * @param array $options */ public function init($options) { parent::init($options); $this->repository = ConfService::getRepository(); if (!is_a($this->repository->driverInstance, "AjxpWrapperProvider")) { return; } $this->accessDriver = $this->repository->driverInstance; $this->urlBase = "pydio://" . $this->repository->getId(); if (array_key_exists("meta.watch", AJXP_PluginsService::getInstance()->getActivePlugins())) { $this->watcher = AJXP_PluginsService::getInstance()->getPluginById("meta.watch"); } }
public function init($options) { parent::init($options); $this->useQueue = $this->pluginConf["USE_QUEUE"]; try { $this->msgExchanger = ConfService::instanciatePluginFromGlobalParams($this->pluginConf["UNIQUE_MS_INSTANCE"], "AJXP_MessageExchanger"); if (AuthService::$bufferedMessage != null && AuthService::getLoggedUser() != null) { $this->sendInstantMessage(AuthService::$bufferedMessage, ConfService::getCurrentRepositoryId(), AuthService::getLoggedUser()->getId()); AuthService::$bufferedMessage = null; } } catch (Exception $e) { } }
public function init($options) { parent::init($options); $this->repository = ConfService::getRepository(); if (!is_a($this->repository->driverInstance, "AjxpWrapperProvider")) { return; } $this->accessDriver = $this->repository->driverInstance; $this->urlBase = $this->repository->driverInstance->getResourceUrl("/"); $this->baseProtocol = array_shift(explode("://", $this->urlBase)); if (array_key_exists("meta.watch", AJXP_PluginsService::getInstance()->getActivePlugins())) { $this->watcher = AJXP_PluginsService::getInstance()->getPluginById("meta.watch"); } }
public function initMeta($accessDriver) { $this->accessDriver = $accessDriver; if (!empty($this->options["index_meta_fields"]) || $this->indexContent) { $metaFields = $this->metaFields; $el = $this->xPath->query("/indexer")->item(0); if ($this->indexContent) { if ($this->indexContent) { $metaFields[] = "ajxp_document_content"; } $data = array("indexed_meta_fields" => $metaFields, "additionnal_meta_columns" => array("ajxp_document_content" => "Content")); $el->setAttribute("indexed_meta_fields", json_encode($data)); } else { $el->setAttribute("indexed_meta_fields", json_encode($metaFields)); } } parent::init($this->options); }
public function init($options) { parent::init($options); // Load all enabled frontend plugins $fronts = AJXP_PluginsService::getInstance()->getPluginsByType("authfront"); usort($fronts, array($this, "frontendsSort")); foreach ($fronts as $front) { if ($front->isEnabled()) { $configs = $front->getConfigs(); $protocol = $configs["PROTOCOL_TYPE"]; if ($protocol == "session_only" && !AuthService::$useSession) { continue; } if ($protocol == "no_session" && AuthService::$useSession) { continue; } AJXP_PluginsService::setPluginActive($front->getType(), $front->getName(), true); } } }
public function init($options) { parent::init($options); $options = $this->options; // BACKWARD COMPATIBILIY PREVIOUS CONFIG VIA OPTIONS if (isset($options["CUSTOM_DATA"])) { $custom = $options["CUSTOM_DATA"]; $serverSettings = $this->xPath->query('//server_settings')->item(0); foreach ($custom as $key => $value) { $n = $this->manifestDoc->createElement("param"); $n->setAttribute("name", $key); $n->setAttribute("label", $value); $n->setAttribute("description", $value); $n->setAttribute("type", "string"); $n->setAttribute("scope", "user"); $n->setAttribute("expose", "true"); $serverSettings->appendChild($n); } $this->reloadXPath(); } }
public function init($options) { parent::init($options); if (!extension_loaded("openssl")) { return; } $keyFile = $this->getPluginWorkDir(true) . "/agent.pem"; if (file_exists($keyFile)) { return; } $config = array("digest_alg" => "sha1", "private_key_bits" => 1024, "private_key_type" => OPENSSL_KEYTYPE_RSA); // Create the private and public key $res = openssl_pkey_new($config); if ($res === false) { AJXP_Logger::error(__CLASS__, __FUNCTION__, "Warning, OpenSSL is active but could not correctly generate a key for Zoho Editor. Please make sure the openssl.cnf file is correctly set up."); while ($message = openssl_error_string()) { AJXP_Logger::debug(__CLASS__, __FUNCTION__, "Open SSL Error: " . $message); } } else { openssl_pkey_export_to_file($res, $keyFile); } }
public function init($repository, $options = null) { //$this->loadActionsFromManifest(); parent::init($options); $this->repository = $repository; }
public function initMeta($accessDriver) { $this->accessDriver = $accessDriver; $messages = ConfService::getMessages(); $def = $this->getMetaDefinition(); $cdataHead = '<div> <div class="panelHeader infoPanelGroup" colspan="2">' . $messages["meta.serial.1"] . '</div> <table class="infoPanelTable" cellspacing="0" border="0" cellpadding="0">'; $cdataFoot = '</table></div>'; $cdataParts = ""; $selection = $this->xPath->query('registry_contributions/client_configs/component_config[@className="FilesList"]/columns'); $contrib = $selection->item(0); $even = false; $searchables = array(); foreach ($def as $key => $label) { $col = $this->manifestDoc->createElement("additional_column"); $col->setAttribute("messageString", $label); $col->setAttribute("attributeName", $key); $col->setAttribute("sortType", "String"); if ($key == "stars_rate") { $col->setAttribute("modifier", "MetaCellRenderer.prototype.starsRateFilter"); $col->setAttribute("sortType", "CellSorterValue"); } else { if ($key == "css_label") { $col->setAttribute("modifier", "MetaCellRenderer.prototype.cssLabelsFilter"); $col->setAttribute("sortType", "CellSorterValue"); } else { $searchables[$key] = $label; } } $contrib->appendChild($col); $trClass = $even ? " class=\"even\"" : ""; $even = !$even; $cdataParts .= '<tr' . $trClass . '><td class="infoPanelLabel">' . $label . '</td><td class="infoPanelValue" id="ip_' . $key . '">#{' . $key . '}</td></tr>'; } $selection = $this->xPath->query('registry_contributions/client_configs/component_config[@className="InfoPanel"]/infoPanelExtension'); $contrib = $selection->item(0); $contrib->setAttribute("attributes", implode(",", array_keys($def))); if (isset($def["stars_rate"]) || isset($def["css_label"])) { $contrib->setAttribute("modifier", "MetaCellRenderer.prototype.infoPanelModifier"); } $htmlSel = $this->xPath->query('html', $contrib); $html = $htmlSel->item(0); $cdata = $this->manifestDoc->createCDATASection($cdataHead . $cdataParts . $cdataFoot); $html->appendChild($cdata); $selection = $this->xPath->query('registry_contributions/client_configs/template_part[@ajxpClass="SearchEngine"]'); $tag = $selection->item(0); $tag->setAttribute("ajxpOptions", json_encode(count($searchables) ? array("metaColumns" => $searchables) : array())); parent::init($this->options); }
public function init($options) { $this->sqlDriver = AJXP_Utils::cleanDibiDriverParameters(array("group_switch_value" => "core")); parent::init($options); }
public function initMeta($accessDriver) { $this->accessDriver = $accessDriver; parent::init($this->options); }
public function init($options) { parent::init($options); }
public function init($options) { parent::init($options); \AJXP_Controller::registerIncludeHook("repository.list", array($this, "populateRemotes")); \AJXP_Controller::registerIncludeHook("repository.search", array($this, "remoteRepositoryById")); }
public function initMeta($accessDriver) { $this->accessDriver = $accessDriver; $store = AJXP_PluginsService::getInstance()->getUniqueActivePluginForType("metastore"); if ($store === false) { throw new Exception("The 'meta.user' plugin requires at least one active 'metastore' plugin"); } $this->metaStore = $store; $this->metaStore->initMeta($accessDriver); //$messages = ConfService::getMessages(); $def = $this->getMetaDefinition(); if (!isset($this->options["meta_visibility"])) { $visibilities = array("visible"); } else { $visibilities = explode(",", $this->options["meta_visibility"]); } $cdataHead = '<div> <div class="panelHeader infoPanelGroup" colspan="2">AJXP_MESSAGE[meta.user.1]</div> <table class="infoPanelTable" cellspacing="0" border="0" cellpadding="0">'; $cdataFoot = '</table></div>'; $cdataParts = ""; $selection = $this->xPath->query('registry_contributions/client_configs/component_config[@className="FilesList"]/columns'); $contrib = $selection->item(0); $even = false; $searchables = array(); $index = 0; $fieldType = "text"; foreach ($def as $key => $label) { if (isset($visibilities[$index])) { $lastVisibility = $visibilities[$index]; } $index++; $col = $this->manifestDoc->createElement("additional_column"); $col->setAttribute("messageString", $label); $col->setAttribute("attributeName", $key); $col->setAttribute("sortType", "String"); if (isset($lastVisibility)) { $col->setAttribute("defaultVisibilty", $lastVisibility); } if ($key == "stars_rate") { $col->setAttribute("modifier", "MetaCellRenderer.prototype.starsRateFilter"); $col->setAttribute("sortType", "CellSorterValue"); $fieldType = "stars_rate"; } else { if ($key == "css_label") { $col->setAttribute("modifier", "MetaCellRenderer.prototype.cssLabelsFilter"); $col->setAttribute("sortType", "CellSorterValue"); $fieldType = "css_label"; } else { if (substr($key, 0, 5) == "area_") { $searchables[$key] = $label; $fieldType = "textarea"; } else { $searchables[$key] = $label; $fieldType = "text"; } } } $contrib->appendChild($col); $trClass = $even ? " class=\"even\"" : ""; $even = !$even; $cdataParts .= '<tr' . $trClass . '><td class="infoPanelLabel">' . $label . '</td><td class="infoPanelValue" data-metaType="' . $fieldType . '" id="ip_' . $key . '">#{' . $key . '}</td></tr>'; } $selection = $this->xPath->query('registry_contributions/client_configs/component_config[@className="InfoPanel"]/infoPanelExtension'); $contrib = $selection->item(0); $contrib->setAttribute("attributes", implode(",", array_keys($def))); if (isset($def["stars_rate"]) || isset($def["css_label"])) { $contrib->setAttribute("modifier", "MetaCellRenderer.prototype.infoPanelModifier"); } $htmlSel = $this->xPath->query('html', $contrib); $html = $htmlSel->item(0); $cdata = $this->manifestDoc->createCDATASection($cdataHead . $cdataParts . $cdataFoot); $html->appendChild($cdata); $selection = $this->xPath->query('registry_contributions/client_configs/template_part[@ajxpClass="SearchEngine"]'); $tag = $selection->item(0); $tag->setAttribute("ajxpOptions", json_encode(count($searchables) ? array("metaColumns" => $searchables) : array())); parent::init($this->options); }
public function init($options) { parent::init($options); $this->sqlDriver = $this->sqlDriver = AJXP_Utils::cleanDibiDriverParameters($options["SQL_DRIVER"]); }
public function initMeta($accessDriver) { require_once "svn_lib.inc.php"; $this->accessDriver = $accessDriver; parent::init($this->options); }
public function initMeta($accessDriver) { $this->accessDriver = $accessDriver; $store = AJXP_PluginsService::getInstance()->getUniqueActivePluginForType("metastore"); if ($store === false) { throw new Exception("The 'meta.user' plugin requires at least one active 'metastore' plugin"); } $this->metaStore = $store; $this->metaStore->initMeta($accessDriver); //$messages = ConfService::getMessages(); $def = $this->getMetaDefinition(); if (!isset($this->options["meta_visibility"])) { $visibilities = array("visible"); } else { $visibilities = explode(",", $this->options["meta_visibility"]); } $cdataHead = '<div> <div class="panelHeader infoPanelGroup" colspan="2"><span class="icon-edit" data-ajxpAction="edit_user_meta" title="AJXP_MESSAGE[meta.user.1]"></span>AJXP_MESSAGE[meta.user.1]</div> <table class="infoPanelTable" cellspacing="0" border="0" cellpadding="0">'; $cdataFoot = '</table></div>'; $cdataParts = ""; $selection = $this->xPath->query('registry_contributions/client_configs/component_config[@className="FilesList"]/columns'); $contrib = $selection->item(0); $even = false; $searchables = array(); $searchablesRenderers = array(); $index = 0; $fieldType = "text"; foreach ($def as $key => $data) { $label = $data["label"]; $fieldType = $data["type"]; if (isset($visibilities[$index])) { $lastVisibility = $visibilities[$index]; } $index++; $col = $this->manifestDoc->createElement("additional_column"); $col->setAttribute("messageString", $label); $col->setAttribute("attributeName", $key); $col->setAttribute("sortType", "String"); if (isset($lastVisibility)) { $col->setAttribute("defaultVisibilty", $lastVisibility); } switch ($fieldType) { case "stars_rate": $col->setAttribute("modifier", "MetaCellRenderer.prototype.starsRateFilter"); $col->setAttribute("sortType", "CellSorterValue"); $searchables[$key] = $label; $searchablesRenderers[$key] = "MetaCellRenderer.prototype.starsRateFilter"; break; case "css_label": $col->setAttribute("modifier", "MetaCellRenderer.prototype.cssLabelsFilter"); $col->setAttribute("sortType", "CellSorterValue"); $searchables[$key] = $label; $searchablesRenderers[$key] = "MetaCellRenderer.prototype.cssLabelsFilter"; break; case "textarea": $searchables[$key] = $label; break; case "string": $searchables[$key] = $label; break; case "choice": $searchables[$key] = $label; $col->setAttribute("modifier", "MetaCellRenderer.prototype.selectorsFilter"); $col->setAttribute("sortType", "CellSorterValue"); $col->setAttribute("metaAdditional", $this->fieldsAdditionalData[$key]); $searchablesRenderers[$key] = "MetaCellRenderer.prototype.selectorsFilter"; break; default: break; } $contrib->appendChild($col); $trClass = $even ? " class=\"even\"" : ""; $even = !$even; $cdataParts .= '<tr' . $trClass . '><td class="infoPanelLabel">' . $label . '</td><td class="infoPanelValue" data-metaType="' . $fieldType . '" id="ip_' . $key . '">#{' . $key . '}</td></tr>'; } $selection = $this->xPath->query('registry_contributions/client_configs/component_config[@className="InfoPanel"]/infoPanelExtension'); $contrib = $selection->item(0); $contrib->setAttribute("attributes", implode(",", array_keys($def))); if (!empty($this->fieldsAdditionalData)) { $contrib->setAttribute("metaAdditional", json_encode($this->fieldsAdditionalData)); } $contrib->setAttribute("modifier", "MetaCellRenderer.prototype.infoPanelModifier"); $htmlSel = $this->xPath->query('html', $contrib); $html = $htmlSel->item(0); $cdata = $this->manifestDoc->createCDATASection($cdataHead . $cdataParts . $cdataFoot); $html->appendChild($cdata); $selection = $this->xPath->query('registry_contributions/client_configs/template_part[@ajxpClass="SearchEngine"]'); foreach ($selection as $tag) { $v = $tag->attributes->getNamedItem("ajxpOptions")->nodeValue; $metaV = count($searchables) ? '"metaColumns":' . json_encode($searchables) : ""; if (count($searchablesRenderers)) { $metaV .= ',"metaColumnsRenderers":' . json_encode($searchablesRenderers); } if (!empty($v) && trim($v) != "{}") { $v = str_replace("}", ", " . $metaV . "}", $v); } else { $v = "{" . $metaV . "}"; } $tag->setAttribute("ajxpOptions", $v); } parent::init($this->options); }