Ejemplo n.º 1
0
 public function importArticles($filename, $dry_run = false)
 {
     // Open the file
     $open_ok = $self->open($filename);
     if ($open_ok !== true) {
         return JError::raiseError(500, $open_ok);
     }
     // Read the data and import the articles
     $num_records = 0;
     while ($self->readNextRecord()) {
         // Create the raw record
         $record = object();
         // Copy in the fields from the CSV data
         $this->bind($record);
         // Verify the category
         $cat_ok = $this->_verifyCategory((int) $record->catid, $record->category_title);
         if ($cat_ok !== true) {
             return JError::raiseError(500, $cat_ok);
         }
         // Verify the creator
         $creator_ok = $this->_verifyUser((int) $record->created_by, $record->created_by_name);
         if ($creator_ok !== true) {
             return JError::raiseError(500, $creator_ok);
         }
         // Save the record
         if (!$dry_run) {
             // ???
         }
         $num_records += 1;
     }
     $this->close();
 }
Ejemplo n.º 2
0
 function __init()
 {
     access_policy('auth');
     $this->menu = $this->makeMenu('index,auth,url' . (object('user')->isAdmin() ? ',#admin,login,server' : ''));
     $this->invokeModel();
     include_once 'lib/cq-forms.php';
 }
Ejemplo n.º 3
0
  function friend_accept($entityKey, $groupId)
  {
    $connection = new HubbubConnection(object('user')->ds['u_entity'], $entityKey);
    $connection->group($groupId);
	  $friendEntity = new HubbubEntity($entityKey);
    return($this->friend_request($friendEntity));
  }
Ejemplo n.º 4
0
 private function check($route)
 {
     if ($this->api->controller->method) {
         return;
     }
     $route_callback = call_user_func_array(array($this->api->controller, 'route'), func_get_args());
     $api_callback = null;
     if ($route_callback->status) {
         $this->api->controller->method = $this->api_method;
         $args_object = object(array('method' => $this->api_method, 'match' => $route_callback->match));
         if ($this->model_api_name) {
             $model_api_name = "api_" . $this->model_api_name;
             // $api_callback = $this->api->controller->model()->$model_api_name($args_object);
             $this->api->controller->model_api_processor = $object = object(array("method" => $model_api_name, "args" => $args_object));
             // $this->api->controller->api_callback = $api_callback;
         }
         if ($this->view_api_name && !\lib\router::get_storage('api')) {
             $view_api_name = "view_" . $this->view_api_name;
             if ($this->model_api_name) {
                 $args_object->api_callback = $api_callback;
             }
             // $api_callback = $this->api->controller->view()->$view_api_name($args_object);
             $this->api->controller->view_api_processor = $object = object(array("method" => $view_api_name, "args" => $args_object));
         }
     }
 }
Ejemplo n.º 5
0
 public function check_route()
 {
     $this->match = object();
     $args = func_get_args();
     if (count($args) == 0) {
         return;
     }
     $route = $args[0];
     $fn = isset($args[1]) ? $args[1] : false;
     if (is_string($route)) {
         $this->url($route);
     } else {
         if (!isset($route['max']) && isset($route['url']) && is_array($route['url'])) {
             $route['max'] = count($route['url']);
         } elseif (!isset($route['max']) && !(isset($route['url']) && is_string($route['url']) && preg_match("/^(\\/.*\\/|#.*#|[.*])[gui]{0,3}\$/i", $route['url']))) {
             $route['max'] = 0;
         }
         foreach ($route as $key => $value) {
             if (method_exists($this, $key)) {
                 $this->{$key}($value);
             }
         }
     }
     if ($this->status === true && is_object($fn)) {
         $arg = array_splice($args, 2);
         array_push($arg, $this->match);
         call_user_func_array($fn, $arg);
     }
     return $this->status;
 }
Ejemplo n.º 6
0
 public function __construct($object = false)
 {
     if (!$object) {
         return;
     }
     $this->controller = $object->controller;
     $this->data = new view\data();
     $this->data->url = object();
     $this->data->include = object();
     $this->data->global = object();
     $this->url = $this->data->url;
     $this->global = $this->data->global;
     $this->include = $this->data->include;
     // default data property
     $this->data->macro['forms'] = 'includes/macro/forms.html';
     // default display value
     $this->data->display['mvc'] = "includes/mvc/display.html";
     $myurl = router::get_protocol() . '://' . router::get_domain() . $_SERVER['REQUEST_URI'];
     if (isset($_SERVER['HTTP_REFERER']) && isset($_SESSION['debug'][md5($_SERVER['HTTP_REFERER'])])) {
         $myurl = $_SERVER['HTTP_REFERER'];
     }
     if (isset($_SESSION['debug'][md5($myurl)])) {
         $this->data->debug = $_SESSION['debug'][md5($myurl)];
         // if(isset($_SESSION['debug'][md5($myurl)]['show']))
         unset($_SESSION['debug'][md5($myurl)]);
         // else
         // $_SESSION['debug'][md5($myurl)]['show'] = true;
     }
     array_push($this->twig_include_path, root);
     if (method_exists($this, 'mvc_construct')) {
         $this->mvc_construct();
     }
 }
Ejemplo n.º 7
0
 function createform($_name, $_type = null)
 {
     $this->data->extendForm = true;
     if (!$this->form) {
         $this->twig_macro('form');
         $this->form = new \lib\form();
         $this->data->form = object();
     }
     $args = func_get_args();
     if (count($args) === 2) {
         $submit_value = T_('submit');
         if ($_type == 'add') {
             $submit_value = T_('submit');
         } elseif ($_type == 'edit') {
             $submit_value = T_('save');
         } elseif ($_type == 'login') {
             $submit_value = T_('sing in');
         } elseif ($_type == 'register') {
             $submit_value = T_('create an account');
         } elseif (!empty($_type)) {
             $submit_value = $_type;
         }
         array_push($args, $submit_value);
     }
     $form = call_user_func_array(array($this->form, 'make'), $args);
     if (get_class($form) == 'lib\\form' || preg_match("/cls\\\\form/", get_class($form))) {
         preg_match("/^(@[^\\.]+)*\\.(.+)\$/", $_name, $sName);
         $this->data->form->{$sName[2]} = $form;
     }
     // if type of form is edit then fill it with related data
     if ($_type == 'edit') {
         $this->form_fill($form, $sName[2]);
     }
     return $form;
 }
Ejemplo n.º 8
0
Archivo: Event.php Proyecto: CDPS/SGTVA
 /**
  * @desc - obtiene todos los registros de events
  * @access public
  * @author Iparra
  * @return object
  */
 public function getAll()
 {
     $query = $this->db->get('events');
     if ($query->num_rows() > 0) {
         return $query->result();
     }
     return object();
 }
Ejemplo n.º 9
0
 public function __construct($object = false)
 {
     if (!$object) {
         return;
     }
     $this->querys = object();
     $this->controller = $object->controller;
     if (method_exists($this, '_construct')) {
         $this->_construct();
     }
 }
Ejemplo n.º 10
0
 /**
  * @param array $array
  *
  * @return object
  */
 function object($array = [])
 {
     $obj = (object) NULL;
     foreach ($array as $key => $value) {
         if (is_array($value)) {
             $value = object($value);
         }
         $obj->{$key} = $value;
     }
     return $obj;
 }
Ejemplo n.º 11
0
 /**
  * require an execommand manifest file
  * @param  string $_file_name manifest file name
  */
 public function manifest_include_file($_file_name)
 {
     if (!array_key_exists($_file_name, manifest::$manifest_file_return)) {
         $manifest = object();
         $req = (require_once $_file_name);
         $manifest = (array) $manifest;
         $manifest = is_array($req) ? $req : $manifest;
         manifest::$manifest_file_return[$_file_name] = $manifest;
     } else {
         $manifest = manifest::$manifest_file_return[$_file_name];
     }
     if (is_array($manifest)) {
         $this->manifest_analyzer($manifest);
     }
 }
Ejemplo n.º 12
0
Archivo: Util.php Proyecto: sherdog/wnd
 public function objectize($data)
 {
     if (is_array($data)) {
         $ret = object($data);
     }
     if (is_string($data)) {
         //see if it's a json struct?
         $tmp = json_decode($data);
         if (is_object($tmp)) {
             $ret = $tmp;
         } else {
             throw new NinjaException("Couldn't convert {$data}", 50);
         }
     }
     return $ret;
 }
Ejemplo n.º 13
0
 /**
  * @param string $lang
  */
 function locale($lang)
 {
     global $config;
     $lang = str_replace('..', '', $lang);
     $lang = str_replace('/', '', $lang);
     if (file_exists($file = '../locale/' . $lang . '.php')) {
         require_once $file;
     } elseif (file_exists($file = '../locale/en_US.php')) {
         require_once $file;
     } else {
         $locale = array();
     }
     if (debug_assert(isset($locale), "locale {$lang} isn't defined")) {
         $config->lang = $lang;
         $config->locale = object($locale);
     }
 }
Ejemplo n.º 14
0
 public function use_powerup($playerID)
 {
     Validate::player($playerID);
     $playerModel = new PlayerModel();
     if ($_POST['payload'] == 'true') {
         Log::add("Payload pre hash: " . print_r($_POST, true));
         $_POST['payload'] = Util::hashPost($_POST);
     }
     $remaining = $playerModel->removePowerup($playerID, $_POST['payload']);
     if ($remaining) {
         $response['status'] = 'ok';
         $response['player'] = object(array("powerups" => $remaining));
     } else {
         $response['status'] = 'error';
     }
     $this->printJson($response);
 }
Ejemplo n.º 15
0
  function setUsername($username)
	{
	  $userObj = object('user');
	  
	  $userObj->isNewUser = $this->ds['u_entity'] == 0;
	  $userObj->server = new HubbubServer(cfg('service/server'), true);
		$userObj->loadEntity();
		
		$userObj->entityDS['user'] = safename($username);
		$userObj->entityDS['url'] = getDefault($userObj->entityDS['url'], cfg('service/server').'/'.(cfg('service/url_rewrite') ? '' : '?').$username);
		$userObj->entityDS['_local'] = 'Y';
		$userObj->entityDS['_serverkey'] = $userObj->server->ds['s_key'];
		$userObj->entityDS['server'] = cfg('service/server');
		
		if(trim($userObj->entityDS['user']) != '') $ekey = DB_UpdateDataset('entities', $userObj->entityDS);
		$userObj->ds['u_entity'] = $ekey;
		
		if(trim($userObj->ds['u_name']) != '') DB_UpdateDataset('users', $userObj->ds);
    if($userObj->isNewUser) h2_execute_event('user_new', $userObj->entityDS, $userObj->ds);
	}
Ejemplo n.º 16
0
 public function toCCCP($configIn = null)
 {
     $ret = array();
     if ($configIn === null) {
         $config = $this->_config;
     } else {
         $config = $configIn;
     }
     if (is_iterable($config)) {
         foreach ($config as $key => $value) {
             if ($key != 'db') {
                 $ret[$key] = $this->toCCCP($value);
             }
         }
     }
     if ($configIn === null) {
         $ret = Zend_Json::encode(object($ret));
     }
     return $ret;
 }
Ejemplo n.º 17
0
 /**
  * constructor
  * @param boolean $object controller
  */
 public function __construct($object = false)
 {
     if (!$object) {
         return;
     }
     $this->controller = $object->controller;
     $this->data = new view\data();
     $this->data->url = object();
     $this->data->include = object();
     $this->data->global = object();
     $this->url = $this->data->url;
     $this->global = $this->data->global;
     $this->include = $this->data->include;
     // default data property
     $this->data->macro['forms'] = 'includes/macro/forms.html';
     $this->data->display['mvc'] = "includes/mvc/display.html";
     $this->data->display['main'] = "content/main/layout.html";
     $this->data->display['home'] = "content/home/display.html";
     $this->data->display['cp'] = "content_cp/home/layout.html";
     $this->data->display['account'] = "content_account/home/layout.html";
     $this->data->template['header'] = 'content/template/header.html';
     $this->data->template['sidebar'] = 'content/template/sidebar.html';
     $this->data->template['footer'] = 'content/template/footer.html';
     $this->data->saloos['version'] = \lib\saloos::getLastVersion();
     $this->data->saloos['lastUpdate'] = \lib\saloos::getLastUpdate();
     $this->data->saloos['langlist'] = ['fa_IR' => 'Persian - فارسی', 'en_US' => 'English', 'ar_SU' => 'Arabic - العربية'];
     $myurl = router::get_protocol() . '://' . router::get_domain() . $_SERVER['REQUEST_URI'];
     if (isset($_SERVER['HTTP_REFERER']) && isset($_SESSION['debug'][md5($_SERVER['HTTP_REFERER'])])) {
         $myurl = $_SERVER['HTTP_REFERER'];
     }
     if (isset($_SESSION['debug'][md5($myurl)])) {
         $this->data->debug = $_SESSION['debug'][md5($myurl)];
         // if(isset($_SESSION['debug'][md5($myurl)]['show']))
         unset($_SESSION['debug'][md5($myurl)]);
         // else
         // $_SESSION['debug'][md5($myurl)]['show'] = true;
     }
     if (method_exists($this, 'mvc_construct')) {
         $this->mvc_construct();
     }
 }
Ejemplo n.º 18
0
                <?= translate('In {category}', array('category' => $category)); ?>
            </span>
        <? endif; ?>

        <? // Downloads ?>
        <? if ($params->show_document_hits && $document->hits): ?>
            <meta itemprop="interactionCount" content="UserDownloads:<?= $document->hits ?>">
            <span class="hits-label">
                <?= object('translator')->choose(array('{number} download', '{number} downloads'), $document->hits, array('number' => $document->hits)) ?>
            </span>
        <? endif ?>
    </p>
    <? endif; ?>

    <? // Download area ?>
    <? if (!object('user')->isAuthentic() || $document->canPerform('download')): ?>
    <div class="docman_download<?php if ($document->description != '') echo " docman_download--right"; ?>">
        <a class="btn btn-large <?= $buttonstyle; ?> btn-block docman_download__button docman_track_download"
           href="<?= $document->download_link; ?>"
           data-title="<?= escape($document->title); ?>"
           data-id="<?= $document->id; ?>"
           <?= $params->download_in_blank_page ? 'target="_blank"' : ''; ?>
            >

            <? // Text  ?>
            <?= translate('Download'); ?>

            <? // Filetype and Filesize  ?>
            <? if (($params->show_document_size && $document->size) || ($document->storage_type == 'file' && $params->show_document_extension)): ?>
                <span class="docman_download__info">(<!--
                --><? if ($document->storage_type == 'file' && $params->show_document_extension): ?><!--
Ejemplo n.º 19
0
function l10n_load($filename_base)
{
    if (isset($GLOBALS['l10n_files'][$filename_base])) {
        return;
    }
    $lang_try = array();
    $usr = object('user');
    if ($usr != null) {
        $lang = $usr->lang;
    }
    if ($lang != '') {
        $lang_try[] = $lang;
    }
    $lang_try[] = 'en';
    foreach ($lang_try as $ls) {
        $lang_file = $filename_base . '.' . $ls . '.cfg';
        if (file_exists($lang_file)) {
            foreach (stringsToStringlist(file($lang_file)) as $k => $v) {
                $GLOBALS['l10n'][$k] = $v;
            }
            $GLOBALS['l10n_files'][$filename_base] = $lang_file;
            if (cfg('l10ndebug') == true) {
                $GLOBALS['l10n_files_last'] = $lang_file;
            }
        }
    }
}
Ejemplo n.º 20
0
/**
 * @package     Nooku_Server
 * @subpackage  Application
 * @copyright   Copyright (C) 2011 - 2012 Timble CVBA and Contributors. (http://www.timble.net).
 * @license     GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
 * @link        http://www.nooku.org
 */
?>

<head>
    <base href="<?php 
echo @url();
?>
" />
    <title><?php 
echo @escape(@object('application')->getCfg('sitename'));
?>
</title>

    <meta content="text/html; charset=utf-8" http-equiv="content-type"  />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <ktml:meta />
    <ktml:link />
    <ktml:style />
    <ktml:script />

    <link href="media://application/images/favicon.ico" rel="shortcut icon" type="image/x-icon" />

    <style src="media://application/stylesheets/default.css" />
    <style src="media://application/stylesheets/print.css" media="print" />
Ejemplo n.º 21
0
<? // Download count field ?>
<div class="koowa_grid__row">
    <div class="control-group koowa_grid__item one-whole">
        <label class="control-label"><?= translate('Downloads'); ?></label>
        <div class="controls" id="hits-container">
            <p class="help-inline">
                <?= $document->hits; ?>
            </p>
            <? if ($document->hits): ?>
                <a href="#" class="btn btn-default btn-small"><?= translate('Reset'); ?></a>
            <? endif; ?>
        </div>
    </div>
</div>

<? // Modified by field ?>
<? if ($document->modified_by): ?>
<div class="koowa_grid__row">
    <div class="control-group koowa_grid__item one-whole">
        <label class="control-label"><?= translate('Modified by'); ?></label>
        <div class="controls">
            <span class="help-info">
            <?= object('user.provider')->load($document->modified_by)->getName(); ?>
            <?= translate('on') ?>
            <?= helper('date.format', array('date' => $document->modified_on)); ?>
            </span>
        </div>
    </div>
</div>
<? endif; ?>
Ejemplo n.º 22
0
        </a>
        <a class="card" href="/studio">
            <img class="card-img-top" src="/files/default/files/studio.jpg" />
            <div class="card-block">
                <h4 class="card-title">
                    RV Studio
                </h4>
                <p class="card-text">
                    Huur onze opnamestudio.
                </p>
            </div>
        </a>
    </div>

    <?php 
    $news = object('com:articles.model.articles')->category('1')->published('1')->limit('5')->getRowset();
    ?>

    <?php 
    if (count($news)) {
        ?>
    <div class="grid grid--narrow">
        <h1 style="margin-top: 40px; margin-bottom: 20px;">
            Nieuws
        </h1>
        <ul>
        <?php 
        foreach ($news as $article) {
            ?>
            <li>
                <a href="<?php 
Ejemplo n.º 23
0
    echo $params_rendered;
    ?>
			</fieldset>
			<?php 
}
?>

			<?php 
if ($module->name == 'mod_custom') {
    ?>
			<fieldset>
				<legend><?php 
    echo @text('Custom Output');
    ?>
</legend>
				<?php 
    echo @object('com:wysiwyg.controller.editor')->render(array('name' => 'content', 'text' => $module->content));
    ?>
			</fieldset>
			<?php 
}
?>
		</div>
	</div>

	<div class="sidebar">
        <?php 
echo @template('default_sidebar.html');
?>
	</div>
</form>
        <a <?php 
if (!$state->position && $state->application == 'site') {
    echo 'class="active"';
}
?>
 href="<?php 
echo route('position=&application=site');
?>
">
            <?php 
echo translate('All positions');
?>
        </a>
	</li>
	<?php 
foreach (array_unique(object('com:pages.model.modules')->application('site')->getRowset()->position) as $position) {
    ?>
	<li>
        <a <?php 
    if ($state->position == $position && $state->application == 'site') {
        echo 'class="active"';
    }
    ?>
 href="<?php 
    echo route('sort=ordering&position=' . $position . '&application=site');
    ?>
">
            <?php 
    echo $position;
    ?>
        </a>
Ejemplo n.º 25
0
                    ?>
">
                            <span><?php 
                    echo $page->title;
                    ?>
</span>
                        </a>
                        <?php 
                    break;
                    ?>

                    <?php 
                case 'menulink':
                    ?>
                        <?php 
                    $page_linked = object('application.pages')->getPage($page->getLink()->query['Itemid']);
                    ?>
                        <a href="<?php 
                    echo $page_linked->getLink();
                    ?>
">
                            <span><?php 
                    echo $page->title;
                    ?>
</span>
                        </a>
                        <?php 
                    break;
                    ?>

                    <?php 
Ejemplo n.º 26
0
    <meta itemprop="height" content="<?= $document->storage->height; ?>">
    <? endif; ?>
    <meta itemprop="contentUrl" content="<?= $document->image_download_path ?>">

    <a class="koowa_media__item__link" data-path="<?= $document->image_path ?>"
       data-title="<?= escape($document->title); ?>"
       data-id="<?= $document->id; ?>"
       data-width="<?= $document->storage->width; ?>"
       data-height="<?= $document->storage->height; ?>"
       href="<?= $document->image_download_path ?>"
       title="<?= escape($document->title) ?>">
<? else:
$modal = false;
if ($document->storage_type === 'file' && !$params->get('force_download'))
{
    $preview_extensions = object('com://site/docman.controller.behavior.previewable')->getGooglePreviewExtensions();
    $extension = $document->extension;
    if (($params->get('preview_with_gdocs') && in_array($extension, $preview_extensions))
        || $extension === 'pdf') {
        $modal = true;
    }
}
?>
    <a class="docman_track_download <?= $modal ? 'koowa_media__item__link koowa_media__item__link--html' : ''; ?>"
       data-title="<?= escape($document->title); ?>"
       data-id="<?= $document->id; ?>"
       href="<?= ($document->download_link) ?>"
       title="<?= escape($document->title) ?>">
<? endif; ?>

        <? if( $document->image_path ): ?>
Ejemplo n.º 27
0
" />
				    </div>
				</div>
				<div>
				    <label for="fax"><?php 
echo translate('Fax');
?>
</label>
				    <div>
				        <input type="text" name="fax" maxlength="255" value="<?php 
echo $contact->fax;
?>
" />
				    </div>
				</div>
			</fieldset>
		</div>
        <?php 
echo object('com:ckeditor.controller.editor')->render(array('name' => 'misc', 'text' => $contact->misc, 'toolbar' => 'basic'));
?>
	</div>

	<div class="sidebar">
        <?php 
echo import('default_sidebar.html');
?>
	</div>
	
</form>

<script data-inline> $jQuery(".select-image").select2(); </script>
Ejemplo n.º 28
0
                                   value="<?= escape($document->title); ?>" />
                        </div>
                    </div>

                    <? if ($show_categories): ?>
                    <div class="control-group submit_document__category_field">
                        <label><?= translate('Category') ?></label>
                        <?=
                        helper('listbox.categories', array(
                            'name'   => 'docman_category_id',
                            'prompt' => $category->title,
                            'deselect' => true,
                            'filter' => array(
                                'parent_id'    => $category->id,
                                'include_self' => true,
                                'access'       => object('user')->getRoles(),
                                'enabled'      => true
                            ))) ?>
                    </div>
                    <? endif ?>

                    <div class="control-group submit_document__document">
                        <ul class="nav nav-tabs">
                            <li>
                                <a href="#" class="upload-method" data-type="file">
                                    <?= translate('Upload a file')?>
                                </a>
                            </li>
                            <li>
                                <a href="#" class="upload-method" data-type="remote">
                                    <?= translate('Submit a link')?>
Ejemplo n.º 29
0
 public function __construct()
 {
     $this->jsonAsserts = [object(['test' => 10, 'expected' => '10']), object(['test' => "10", 'expected' => '"10"']), object(['test' => "1'0", 'expected' => '"1\\u20190"']), object(['test' => [10], 'expected' => "[10]"]), object(['test' => [10, "10", "1'0"], 'expected' => '[10,"10","1\\u20190"]']), object(['test' => object([10, "10", "1'0"]), 'expected' => '{"0":10,"1":"10","2":"1\\u20190"}'])];
     $this->arrayAsserts = [object(['test' => [10], 'expected' => "10"]), object(['test' => [10, "10", "1'0"], 'expected' => '10,10,1\\u20190']), object(['test' => [10, "10", "test"], 'expected' => '10,10,test'])];
 }
Ejemplo n.º 30
0
<?php 
/* Image and article buttons needs this in order to work */
echo @helper('behavior.modal');
?>

<?php 
if ($options['toggle']) {
    ?>
    <style src="media://wysiwyg/css/form.css" />
    <script src="media://wysiwyg/js/Fx.Toggle.js" />
<?php 
}
?>

<script src="media://wysiwyg/tinymce/tiny_mce<?php 
echo @object('application')->getCfg('debug') ? '_src.js' : '.js';
?>
" />
<script src="media://wysiwyg/js/Editor.js" />

<?php 
if ($codemirror) {
    ?>
<script src="media://wysiwyg/codemirror/lib/codemirror.js" />
<script src="media://wysiwyg/codemirror/mode/css/css.js" />
<script src="media://wysiwyg/codemirror/mode/htmlmixed/htmlmixed.js" />
<script src="media://wysiwyg/codemirror/mode/javascript/javascript.js" />
<script src="media://wysiwyg/codemirror/mode/php/php.js" />
<script src="media://wysiwyg/codemirror/mode/xml/xml.js" />

<style src="media://wysiwyg/codemirror/lib/codemirror.css" />