Esempio n. 1
0
 public function mergeLibraryConfig($defaultLibraryName, $defaults)
 {
     $libraryName = ar::getvar('arLibrary');
     if (is_numeric($libraryName) || $libraryName == 'current') {
         // library is loaded unnamed
         $libraryName = $defaultLibraryName;
     }
     if ($libraryName) {
         $userConfig = ar::acquire('defaults.' . $libraryName);
         if (isset($userConfig) && is_array($userConfig)) {
             $defaults = array_merge($defaults, $userConfig);
         }
     }
     return array_merge($defaults, $this->getvar('arCallArgs'));
 }
Esempio n. 2
0
echo $this->make_local_url($this->currentsite(), $nls);
?>
';
	var vdCurrentPath=objectPath;
	var vdBrowseRoot='<?php 
echo $vdBrowseRoot;
?>
';
	var vdSelection = null;
	var vdSelectionState = null;
	var tbContentEditOptions = <?php 
echo json_encode($options);
?>
;
	var vdOpenMetaPane = <?php 
echo ar::getvar('vdOpenMeta') ? 'true' : 'false';
?>
;
	var vdEditPane;
	var vdMetaPane;
	var vdEditorCanvas;
	var vdEditorFrame;
	var vdContextBar=false;
	var vdUndoEnabled=true;
	var vdMetaDataSlideEnabled=false;
	var vdHtmlContextHides=false;
	var vdTableDesigner;
	var vdLanguages = <?php 
echo json_encode($AR->nls->list);
?>
;
Esempio n. 3
0
 protected function getvar($name)
 {
     if (preg_match("/(\\w+)\\[(.*?)]/", $name, $matches)) {
         $arrayvalue = ar::getvar($matches[1]);
         $value = $this->getArrayValue(substr($name, strlen($matches[1])), $arrayvalue);
     } else {
         $value = ar()->getvar($name);
     }
     return $value;
 }
Esempio n. 4
0
 public function login($consumerKey = null, $consumerSecret = null, $callback = '', $redirect = true)
 {
     // FIXME: $redirect should probably be allowed to be an object that implements a redirect() method
     $session = ar_loader::session();
     //FIXME: allow different session object to be passed
     if (!$session->id()) {
         $session->start();
     }
     if (isset($callback) && substr((string) $callback, 0, 4) != 'http' && $callback != 'oob') {
         $callback = ar_loader::makeURL() . $callback;
     }
     if (!$this->client instanceof ar_connect_oauthClient) {
         ////FIXME: a real OAuth is also ok
         // FIXME: what if you want a caching client?
         $this->client = ar_connect_oauth::client($consumerKey, $consumerSecret);
         if (ar_error::isError($this->client)) {
             return $this->client;
         }
     }
     $access_token = $session->getvar('access_token');
     $access_token_secret = $session->getvar('access_token_secret');
     if ($access_token && $access_token_secret) {
         $this->client->setToken($access_token, $access_token_secret);
         return true;
     }
     $oauth_verifier = $session->getvar('oauth_verifier');
     $oauth_token = $session->getvar('oauth_token');
     $oauth_token_secret = $session->getvar('oauth_token_secret');
     if (!$oauth_verifier) {
         $oauth_verifier = ar::getvar('oauth_verifier');
         if ($oauth_verifier) {
             $session->putvar('oauth_verifier', $oauth_verifier);
         } else {
             if (!$callback) {
                 $callback = 'oob';
             }
             $info = $this->client->getRequestToken('https://api.twitter.com/oauth/request_token', (string) $callback);
             if (ar_error::isError($info)) {
                 $info->debugInfo = $this->client->debugInfo;
                 return $info;
             }
             $this->client->setToken($info['oauth_token'], $info['oauth_token_secret']);
             $session->putvar('oauth_token', $info['oauth_token']);
             $session->putvar('oauth_token_secret', $info['oauth_token_secret']);
             if ($redirect) {
                 ar_loader::redirect('https://api.twitter.com/oauth/authorize?oauth_token=' . RawUrlEncode($info['oauth_token']));
                 return false;
             } else {
                 return 'https://api.twitter.com/oauth/authorize?oauth_token=' . RawUrlEncode($info['oauth_token']);
             }
         }
     }
     if ($oauth_verifier) {
         $this->client->setToken($oauth_token, $oauth_token_secret);
         $info = $this->client->getAccessToken('https://api.twitter.com/oauth/access_token', '', $oauth_verifier);
         if (ar_error::isError($info)) {
             $info->debugInfo = $this->client->debugInfo;
             return $info;
         }
         $access_token = $info['oauth_token'];
         $access_token_secret = $info['oauth_token_secret'];
         $this->client->setToken($access_token, $access_token_secret);
         $session->putvar('access_token', $access_token);
         $session->putvar('access_token_secret', $access_token_secret);
         return $info;
     }
     return false;
 }
Esempio n. 5
0
File: ar.php Progetto: poef/ariadne
 public static function _getvar($name)
 {
     return ar::getvar($name);
 }
Esempio n. 6
0
<?php

$colDefs = ar::getvar('columns');
$defaults = array("name" => $this->nlsdata->name, "filename" => basename($this->path), "path" => $this->path, "parent" => $this->parent, "type" => $this->type, "size" => $this->size, "owner" => $this->data->config->owner, "lastchanged" => date("Y-m-d H:i", $this->lastchanged), "modified" => date("Y-m-d H:i", $this->data->mtime), "created" => date("Y-m-d H:i", $this->data->ctime), "language" => $this->data->nls->list, 'local_url' => $this->make_ariadne_url(), 'priority' => $this->priority, "vtype" => $this->vtype, "icons" => array("small" => $ARCurrent->arTypeIcons[$this->type]["small"] ? $ARCurrent->arTypeIcons[$this->type]["small"] : $this->call('system.get.icon.php', array('size' => 'small')), "medium" => $ARCurrent->arTypeIcons[$this->type]["medium"] ? $ARCurrent->arTypeIcons[$this->type]["medium"] : $this->call('system.get.icon.php', array('size' => 'medium')), "large" => $ARCurrent->arTypeIcons[$this->type]["large"] ? $ARCurrent->arTypeIcons[$this->type]["large"] : $this->call('system.get.icon.php', array('size' => 'large'))));
if (!$colDefs) {
    $colDefs = $defaults;
}
if (!isset($colDefs["local_url"])) {
    $colDefs["local_url"] = $defaults["local_url"];
}
$arResult = [];
//FIXME: needs refactoring, or \arc\hash::get() must accept '/' as 'return the root entry itself'
foreach ($colDefs as $key => $colDef) {
    if (array_key_exists($key, $defaults)) {
        $arResult[$key] = $defaults[$key];
    } else {
        if ($colDef['call']) {
            $arResult[$key] = ar::call($colDef['call'], $colDef);
        } else {
            if ($colDef['entry']) {
                $root = \arc\path::head($colDef['entry']);
                $tail = \arc\path::tail($colDef['entry']);
                switch ($root) {
                    case 'data':
                        $first = \arc\path::head($tail);
                        $tail = \arc\path::tail($tail);
                        if (is_object($this->data->{$first})) {
                            $item = \arc\path::head($tail);
                            $tail = \arc\path::tail($tail);
                            if ($tail == '/') {
                                $arResult[$key] = $this->data->{$first}->{$item};
<?php

$arLanguage = ar::getvar('arLanguage');
if (!$arLanguage || $arLanguage != $ARConfig->nls->default) {
    return;
}
$scaffoldConfig = ar::acquire('settings.scaffolds');
if ($scaffoldConfig) {
    if (!is_array($scaffoldConfig)) {
        $scaffoldConfig = array($scaffoldConfig);
    }
    $count = 0;
    foreach ($scaffoldConfig as $scaffold) {
        $query = "object.type = '" . $this->type . "' and object.parent='" . $scaffold . $this->type . "/' and name.nls='{$arLanguage}'";
        $count += ar::get($scaffold . $this->type)->find($query)->count();
    }
    if ($count) {
        ?>
<div class="field">
	<label for="scaffold"><?php 
        echo $ARnls["ariadne:scaffold"];
        ?>
</label>
	<select id="scaffold" type="text" name="scaffold" class="selectline">
		<option value=""><?php 
        echo $ARnls["ariadne:noscaffold"];
        ?>
</option>
		<?php 
        foreach ($scaffoldConfig as $scaffold) {
            $query = "object.type = '" . $this->type . "' and object.parent='" . $scaffold . $this->type . "/' and name.nls='{$arLanguage}'";
Esempio n. 8
0
<?php

include_once "dialog.grants.logic.php";
include_once $this->store->get_config("code") . "modules/mod_yui.php";
include_once $this->store->get_config("code") . "modules/mod_grant.php";
include_once $this->store->get_config("code") . "ar.php";
$userConfig = $this->loadUserConfig();
$authconfig = $userConfig['authentication'];
define('ARGRANTBYTYPE', 8);
$selectedpath = $this->getdata("selectedpath");
$selecteduser = $this->getdata("selecteduser");
$moregrants = $this->getdata("moregrants");
$textmode = $this->getdata("textmode");
$stored_vars = $this->getdata("arStoreVars");
$data = $this->getdata('data');
$textswitch = ar::getvar("textmode", "post");
if (!$selectedpath) {
    $selectedpath = $this->path;
}
$defaultGroupDir = "/system/groups/";
if (is_array($authconfig['groupdirs'])) {
    $defaultGroupDir = end($authconfig['groupdirs']);
}
$default_grants = array("read" => "Read", "add" => "Add", "edit" => "Edit", "layout" => "Layout", "config" => "Config", "delete" => "Delete", "none" => "None");
$available_grants = $default_grants;
$users = array();
$selectedob = current($this->get($selectedpath, "system.get.phtml"));
while ($selectedob->parent != '..') {
    if ($selectedob && $selectedob->data->config->grants) {
        foreach ($selectedob->data->config->grants as $type => $grant) {
            foreach ($grant as $id => $grants) {