예제 #1
0
 public function _call_super($arCallArgs = "")
 {
     global $ARCurrent, $AR;
     $context = $this->getContext();
     if (!$arCallArgs) {
         $arCallArgs = end($ARCurrent->arCallStack);
     }
     $arSuperContext = (array) $context['arSuperContext'];
     $arLibrary = $context['arLibrary'];
     $arLibraryPath = $context['arLibraryPath'];
     $arCallType = $context['arCallTemplateType'];
     $arSuperPath = $context['arCallTemplatePath'];
     $arLibrariesSeen = $context['arLibrariesSeen'];
     $arCallFunction = $arSuperFunction = $context['arCallFunction'];
     if ($arLibrary) {
         $arSuperFunction = str_replace($arLibrary . ':', '', $arCallFunction);
     }
     if (strpos($arSuperFunction, "::") !== false) {
         // template of a specific class defined via call("class::template");
         list($arBaseType, $arSuperFunction) = explode("::", $arSuperFunction);
     }
     // remove current library path from the arLibrariesSeen array so that
     // Ariadne will be able to re-enter the library and toggle the arSuperContext boolean there.
     unset($arLibrariesSeen[$arLibraryPath]);
     $arSuperContext[$arSuperPath . ":" . $arCallType . ":" . $arSuperFunction] = true;
     debug("call_super: searching for the template following (path: {$arSuperPath}; type: {$arCallType}; function: {$arCallFunction}) from {$this->path}");
     // FIXME: Redirect code has to move to getPinpTemplate()
     $redirects = $ARCurrent->shortcut_redirect;
     if (isset($redirects) && is_array($redirects)) {
         $redirpath = $this->path;
         while (!$template['arTemplateId'] && ($redir = array_pop($redirects)) && $redir["keepurl"] && substr($redirpath, 0, strlen($redir["dest"])) == $redir["dest"]) {
             debug("call_super: following shortcut redirect: {$redirpath}; to " . $redir["dest"]);
             $template = $this->getPinpTemplate($arCallFunction, $redirpath, $redir["dest"], false, $arLibrariesSeen, $arSuperContext);
             $redirpath = $redir['src'];
         }
         if (!$template["arTemplateId"]) {
             $template = $this->getPinpTemplate($arCallFunction, $redirpath, '', false, $arLibrariesSeen, $arSuperContext);
         }
     }
     if (!$template["arTemplateId"]) {
         $template = $this->getPinpTemplate($arCallFunction, $this->path, '', false, $arLibrariesSeen, $arSuperContext);
     }
     if ($template["arCallTemplate"] && $template["arTemplateId"]) {
         $exists = ar('template')->exists($template['arCallTemplatePath'], $template["arCallTemplate"]);
         if ($exists) {
             debug("call_super: found template " . $template["arCallTemplate"] . " on object with id " . $template["arTemplateId"]);
             $arLibrary = $template['arLibrary'];
             debug("call_super: found template on " . $template["arTemplateId"]);
             if (is_int($arLibrary)) {
                 // set the library name for unnamed libraries to 'current'
                 // so that calls using getvar('arLibrary') will keep on working
                 $arLibrary = "current";
             }
             if (!is_string($arCallArgs)) {
                 $arCallArgs['arCallFunction'] = $arCallFunction;
                 $arCallArgs['arLibrary'] = $arLibrary;
                 $arCallArgs['arLibraryPath'] = $template["arLibraryPath"];
             }
             $ARCurrent->arCallStack[] = $arCallArgs;
             $this->pushContext(array("scope" => "pinp", "arSuperContext" => $arSuperContext, "arLibrary" => $arLibrary, "arLibraryPath" => $template['arLibraryPath'], "arCallFunction" => $arCallFunction, "arCurrentObject" => $this, "arCallType" => $template['arCallType'], "arCallTemplateName" => $template['arCallTemplateName'], "arCallTemplateNLS" => $template['arCallTemplateNLS'], "arCallTemplateType" => $template['arCallTemplateType'], "arCallTemplatePath" => $template['arCallTemplatePath']));
             $continue = true;
             $eventData = new object();
             if (!$AR->contextCallHandler) {
                 /* prevent onbeforecall from re-entering here */
                 $AR->contextCallHandler = true;
                 $eventData->arCallArgs = $arCallArgs;
                 $eventData->arCallFunction = $arCallFunction;
                 $eventData->arContext = $this->getContext();
                 $eventData = ar_events::fire('onbeforecall', $eventData);
                 $ARCurrent->arResult = $eventData->arResult;
                 $AR->contextCallHandler = false;
                 $continue = $eventData != false;
             }
             if ($continue) {
                 set_error_handler(array('pobject', 'pinpErrorHandler'), error_reporting());
                 $func = ar('template')->get($template['arCallTemplatePath'], $template['arCallTemplate']);
                 if (is_callable($func)) {
                     $arResult = $func($this);
                 }
                 restore_error_handler();
                 if (!$AR->contextCallHandler) {
                     /* prevent oncall from re-entering here */
                     $AR->contextCallHandler = true;
                     $temp = $ARCurrent->arResult;
                     /* event listeners will change ARCurrent->arResult */
                     $eventData->arResult = $arResult;
                     ar_events::fire('oncall', $eventData);
                     $ARCurrent->arResult = $temp;
                     /* restore correct result */
                     $AR->contextCallHandler = false;
                 }
             }
             array_pop($ARCurrent->arCallStack);
             $this->popContext();
         }
     }
     return $arResult;
 }
예제 #2
0
 type="checkbox" name="arNewFilename" value="{5:id}" id="autonumber" >
				<label for="autonumber"><?php 
        echo $ARnls["ariadne:new:autonumber"];
        ?>
</label>
			</div>
		</div>
		<div class="left">
			<div class="field">
				<label for="arNewFilename" class="required"><?php 
        echo $ARnls["filename"];
        ?>
</label>
				<input id="arNewFilename" class="inputline wgWizAutoSelect wgWizAutoFocus" <?php 
        echo $inputDisabled;
        ?>
 type="text" name="arNewFilename" value="<?php 
        echo $arNewFilename;
        ?>
">
				<div class="help"><?php 
        echo $ARnls['ariadne:new:lettersnumbers'];
        ?>
</div>
			</div>
		</div>
	</fieldset>
<?php 
        ar_events::fire('onnewfilename', $eventData);
    }
}
예제 #3
0
\t\t\tmuze.event.attach( document.body, 'click', function(evt) {
\t\t\t\tevt = muze.event.get(evt);
\t\t\t\tmuze.ariadne.explore.viewpane.onClick(evt);
\t\t\t});
\t\t\tYAHOO.util.Event.addListener('archildren', 'selected', muze.ariadne.explore.viewpane.onSelected);
\t\t\tYAHOO.util.Event.addListener('archildren', 'clearselection', muze.ariadne.explore.viewpane.unselectItem);
\t\t});
\t</script>
\t<div class="browse viewpane {$viewtype}" id="viewpane">
EOF;
    yui::showPaging($object_count, $items_per_page, $current_page, "top");
    if ($viewtype == "details") {
        yui::showTable($divId, $tableId, $colDefs, $datalist);
        echo <<<EOF
\t\t\t<script type="text/javascript">
\t\t\t\tYAHOO.util.Event.onDOMReady(muze.ariadne.explore.viewpane.load_handler);
\t\t\t</script>
EOF;
    } else {
        yui::showList(['objects' => $object_list, 'total' => $object_count], $viewtype);
    }
    echo '<div class="viewpane_footer"></div>';
    yui::showPaging($object_count, $items_per_page, $current_page, "bottom");
    echo <<<EOF
\t</div>
<article class="dropzoneInfo">
\t<progress id="uploadprogress" class="uploadprogress" min="0" max="100" value="0">0</progress>
</article>
EOF;
    ar_events::fire('ariadne:onexplore', $eventData);
}
예제 #4
0
파일: loader.web.php 프로젝트: poef/ariadne
function ldObjectNotFound($requestedpath, $requestedtemplate, $requestedargs = null)
{
    global $store, $AR, $ARCurrent, $args;
    $path = $requestedpath;
    if (!$requestedargs) {
        $requestedargs = $args;
    }
    if (!$path) {
        error("Empty path requested with template: {$requestedtemplate}");
    } else {
        $prevPath = null;
        while ($path !== $prevPath && !$store->exists($path)) {
            $prevPath = $path;
            $path = $store->make_path($path, "..");
        }
        if (count($ARCurrent->arCallStack) == 0) {
            $arCallArgs = $requestedargs;
        } else {
            $arCallArgs = @array_pop($ARCurrent->arCallStack);
            @array_push($ARCurrent->arCallStack, $arCallArgs);
        }
        if ($prevPath == $path) {
            error("Database is not initialised, please run <a href=\"" . $AR->dir->www . "install/install.php\">the installer</a>");
        } else {
            // make sure the config check has been run:
            $ob = current($store->call('system.get.phtml', array(), $store->get($path)));
            $ob->loadConfig();
            //CheckConfig();
            $ob->pushContext(array("arSuperContext" => array(), "arCurrentObject" => $ob, "scope" => "php", "arCallFunction" => $requestedtemplate));
            $eventData = new object();
            $eventData->arCallPath = $requestedpath;
            $eventData->arCallFunction = $requestedtemplate;
            $eventData->arCallArgs = $arCallArgs;
            $eventData = ar_events::fire('onnotfound', $eventData);
            if ($eventData) {
                // no results: page couldn't be found, show user definable 404 message
                $arCallArgs = (array) $eventData->arCallArgs;
                $requestedargs = $arCallArgs;
                $myarCallArgs = array_merge($arCallArgs, array("arRequestedPath" => $requestedpath, "arRequestedTemplate" => $requestedtemplate, "arRequestedArgs" => $requestedargs));
                $store->call("user.notfound.html", $myarCallArgs, $store->get($path));
            }
            $ob->popContext();
        }
    }
}
예제 #5
0
function ldAccessPasswordExpired($path, $message, $args = null, $function = null)
{
    global $ARCurrent, $store;
    /*
    	since there is no 'peek' function, we need to pop and push
    	the arCallArgs variable.
    */
    if (isset($args)) {
        $arCallArgs = $args;
    } else {
        $arCallArgs = @array_pop($ARCurrent->arCallStack);
        @array_push($ARCurrent->arCallStack, $arCallArgs);
    }
    $eventData = new object();
    $eventData->arCallPath = $path;
    $eventData->arCallFunction = ldGetCurrentTemplate($function);
    $eventData->arLoginMessage = $message;
    $eventData->arReason = 'password expired';
    $eventData->arCallArgs = $arCallArgs;
    $eventData = ar_events::fire('onaccessdenied', $eventData);
    if ($eventData) {
        $arCallArgs = $eventData->arCallArgs;
        $arCallArgs["arLoginMessage"] = $eventData->arLoginMessage;
        if (!$ARCurrent->arLoginSilent) {
            $ARCurrent->arLoginSilent = true;
            $store->call("user.password.expired.html", $arCallArgs, $store->get($path));
        }
    }
}
예제 #6
0
    $settingsEventData = new object();
    $settingsEventData = ar_events::fire('ariadne:onbeforesidebarsettings', $settingsEventData);
    if ($settingsEventData) {
        // Do the stuff you need to do.
        $this->call("explore.sidebar.settings.php", $arCallArgs);
        ar_events::fire('ariadne:onsidebarsettings');
    }
    if (getenv("ARIADNE_WORKSPACE") && workspace::enabled($this->path)) {
        $this->call("explore.sidebar.workspace.php", $arCallArgs);
    }
    if ($AR->SVN->enabled) {
        $svnEventData = new object();
        $svnEventData = ar_events::fire('ariadne:onbeforesidebarsvn', $svnEventData);
        if ($svnEventData) {
            $this->call("explore.sidebar.svn.php", $arCallArgs);
            ar_events::fire('ariadne:onsidebarsvn');
        }
    }
    $infoEventData = new object();
    $infoEventData = ar_events::fire('ariadne:onbeforesidebarinfo', $infoEventData);
    if ($infoEventData) {
        $this->call("explore.sidebar.info.php", $arCallArgs);
        ar_events::fire('ariadne:onsidebarinfo');
    }
    $detailsEventData = new object();
    $detailsEventData = ar_events::fire('ariadne:onbeforesidebardetails', $detailsEventData);
    if ($detailsEventData) {
        $this->call("explore.sidebar.details.php", $arCallArgs);
        ar_events::fire('ariadne:onsidebardetails');
    }
}
예제 #7
0
	<div class="explore_buttons">
		<form action="" onsubmit="callback(); return false;">
			<div class="buttons">
				<div class="left">
					<input type="file" multiple name="file[]" id="upload">
					<button for="upload" class="button" onclick="muze.event.fire(document.getElementById('upload'), 'click'); return false"><?php 
    echo $ARnls['ariadne:uploader'];
    ?>
</button>
					<?php 
    $extraButtonsEventData = new object();
    $extraButtonsEventData = ar_events::fire('ariadne:onbeforebrowsebuttons', $extraButtonsEventData);
    if ($extraButtonsEventData) {
        $this->call("dialog.browse.buttons.html", array("hideAdd" => $hideAdd));
        $this->call("dialog.browse.buttons.extra.html");
        ar_events::fire('ariadne:onbrowsebuttons');
    }
    ?>
</div>
				<div class="right">
					<input type='submit' value='<?php 
    echo $ARnls['cancel'];
    ?>
' onclick="window.close(); return false;">
					<input type='submit' value='<?php 
    echo $ARnls['ariadne:browse:select'];
    ?>
' onclick="callback(); return false;">
				</div>
			</div>
		</form>
예제 #8
0
파일: events.php 프로젝트: poef/ariadne
 public function fire($eventName, $eventData, $objectType = null)
 {
     return ar_events::fire($eventName, $eventData, $objectType = null, $this->path);
 }