本文整理汇总了PHP中AJXP_Plugin类的典型用法代码示例。如果您正苦于以下问题:PHP AJXP_Plugin类的具体用法?PHP AJXP_Plugin怎么用?PHP AJXP_Plugin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AJXP_Plugin类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: frontendsSort
/**
* @param AJXP_Plugin $a
* @param AJXP_Plugin $b
* @return int
*/
public function frontendsSort($a, $b)
{
$aConf = $a->getConfigs();
$bConf = $b->getConfigs();
$orderA = intval($aConf["ORDER"]);
$orderB = intval($bConf["ORDER"]);
if ($orderA == $orderB) {
return 0;
}
return $orderA > $orderB ? 1 : -1;
}
示例2: init
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);
}
}
示例3: init
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;
}
示例4: init
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);
}
}
示例5: init
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");
}
}
示例6: parseSpecificContributions
protected function parseSpecificContributions(&$contribNode)
{
parent::parseSpecificContributions($contribNode);
if ($this->detectStreamWrapper() !== false) {
$this->actions["cross_copy"] = array();
}
}
示例7: parseSpecificContributions
/**
* Parse
* @param DOMNode $contribNode
*/
protected function parseSpecificContributions(&$contribNode)
{
parent::parseSpecificContributions($contribNode);
if ($this->pluginConf["ENABLE_324_IMPORT"] == true) {
return;
}
if ($contribNode->nodeName != "actions") {
return;
}
$actionXpath = new DOMXPath($contribNode->ownerDocument);
$compressNodeList = $actionXpath->query('action[@name="import_from_324"]', $contribNode);
if (!$compressNodeList->length) {
return;
}
unset($this->actions["import_from_324"]);
$compressNode = $compressNodeList->item(0);
$contribNode->removeChild($compressNode);
$compressNodeList = $actionXpath->query('action[@name="migrate_metaserial"]', $contribNode);
if (!$compressNodeList->length) {
return;
}
unset($this->actions["import_from_324"]);
$compressNode = $compressNodeList->item(0);
$contribNode->removeChild($compressNode);
}
示例8: logDebug
public function logDebug($message = "")
{
parent::logDebug("core.indexer", $message);
if ($this->verboseIndexation && ConfService::currentContextIsCommandLine()) {
print $message . "\n";
}
}
示例9: loadRegistryContributions
public function loadRegistryContributions()
{
$currentUser = AuthService::getLoggedUser();
if ($currentUser != null) {
$cData = $currentUser->getPref("CUSTOM_PARAMS");
if ($cData != null && isset($cData["email"])) {
$this->exposeConfigInManifest("current_user_email", $cData["email"]);
}
}
$actionsBranch = $this->xPath->query("registry_contributions/actions");
$actionsNode = $actionsBranch->item(0);
foreach (array_map("trim", explode(",", $this->pluginConf["ACTIONS"])) as $action) {
// Action node
$prop = $this->manifestDoc->createElement("action");
$attName = $this->manifestDoc->createAttribute("name");
$attValue = $this->manifestDoc->createTextNode($action);
$attName->appendChild($attValue);
$prop->appendChild($attName);
$actionsNode->appendChild($prop);
// Pre_proc
$preproc = $this->manifestDoc->createElement("pre_processing");
$prop->appendChild($preproc);
// Server callback
$sC = $this->manifestDoc->createElement("serverCallback");
$sAttName = $this->manifestDoc->createAttribute("methodName");
$sAttValue = $this->manifestDoc->createTextNode("preProcess");
$sAttName->appendChild($sAttValue);
$sC->appendChild($sAttName);
$preproc->appendChild($sC);
}
$this->reloadXPath();
parent::loadRegistryContributions();
}
示例10: parseSpecificContributions
public function parseSpecificContributions(&$contribNode)
{
parent::parseSpecificContributions($contribNode);
if ($contribNode->nodeName != "actions") {
return;
}
$actionXpath = new DOMXPath($contribNode->ownerDocument);
$paramList = $actionXpath->query('action[@name="scheduler_addTask"]/processing/standardFormDefinition/param[@name="repository_id"]', $contribNode);
if (!$paramList->length) {
return;
}
$paramNode = $paramList->item(0);
$sVals = array();
$repos = ConfService::getRepositoriesList("all");
foreach ($repos as $repoId => $repoObject) {
$sVals[] = $repoId . "|" . AJXP_Utils::xmlEntities($repoObject->getDisplay());
}
$sVals[] = "*|All Repositories";
$paramNode->attributes->getNamedItem("choices")->nodeValue = implode(",", $sVals);
if (!AuthService::usersEnabled() || AuthService::getLoggedUser() == null) {
return;
}
$paramList = $actionXpath->query('action[@name="scheduler_addTask"]/processing/standardFormDefinition/param[@name="user_id"]', $contribNode);
if (!$paramList->length) {
return;
}
$paramNode = $paramList->item(0);
$paramNode->attributes->getNamedItem("default")->nodeValue = AuthService::getLoggedUser()->getId();
}
示例11: initMeta
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);
}
示例12: init
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) {
}
}
示例13: loadConfigs
public function loadConfigs($configsData)
{
parent::loadConfigs($configsData);
if (isset($configsData["UNOCONV"]) && !empty($configsData["UNOCONV"])) {
// APPEND THE UNOCONV SUPPORTED EXTENSIONS
$this->manifestDoc->documentElement->setAttribute("mimes", implode(",", array_merge($this->imagickExtensions, $this->unoconvExtensios)));
} else {
$this->manifestDoc->documentElement->setAttribute("mimes", implode(",", $this->imagickExtensions));
}
}
示例14: loadConfigs
public function loadConfigs($configData)
{
parent::loadConfigs($configData);
if (!defined("AJXP_THEME_FOLDER")) {
define("CLIENT_RESOURCES_FOLDER", AJXP_PLUGINS_FOLDER . "/gui.ajax/res");
define("AJXP_THEME_FOLDER", CLIENT_RESOURCES_FOLDER . "/themes/" . $this->pluginConf["GUI_THEME"]);
}
if (!isset($configData["CLIENT_TIMEOUT_TIME"])) {
$this->pluginConf["CLIENT_TIMEOUT_TIME"] = intval(ini_get("session.gc_maxlifetime"));
}
}
示例15: loadConfigs
public function loadConfigs($configData)
{
parent::loadConfigs($configData);
$keyFile = $this->getPluginWorkDir(true) . "/agent.pem";
if (file_exists($keyFile)) {
$res = openssl_pkey_get_private(file_get_contents($keyFile));
$details = openssl_pkey_get_details($res);
$public = $details["key"];
$this->pluginConf["ZOHO_AGENT_PUBLIC_KEY"] = $public;
}
}