function show_php_error($severity, $message, $filepath, $line)
 {
     $severity = !isset($this->levels[$severity]) ? $severity : $this->levels[$severity];
     $filepath = str_replace("\\", "/", $filepath);
     // For safety reasons we do not show the full file path
     if (FALSE !== strpos($filepath, '/')) {
         $x = explode('/', $filepath);
         $filepath = $x[count($x) - 2] . '/' . end($x);
     }
     // BEGIN DATABASE LOGGING
     $CI =& get_instance();
     if (is_object($CI) && (!property_exists($CI, 'debugmode') || $CI->debugmode != TRUE)) {
         $e = new Error();
         $e->source = '';
         $e->severity = $severity;
         $e->message = $message;
         $e->filepath = $filepath;
         $e->line = $line;
         $e->application = property('application', $CI, '');
         if (property_exists($CI, 'user')) {
             $e->user_id = $CI->user->id;
         }
         $e->save();
         $error_id = $e->id;
     }
     // END DATABASE LOGGING
     if (ob_get_level() > $this->ob_level + 1) {
         ob_end_flush();
     }
     ob_start();
     include APPPATH . 'errors/error_php' . EXT;
     $buffer = ob_get_contents();
     ob_end_clean();
     echo $buffer;
 }
 protected function preRender()
 {
     $id = property($this->props, 'id');
     if ($id) {
         $this->props->containerId = $this->props->id . 'Container';
     }
     parent::preRender();
 }
Esempio n. 3
0
/**
* Creates a new array of values by running each element in a collection
* through an iteratee function.
*
* Keys in the original collection _are_ preserved.
*
* @param array|object $collection
* @param Callable $iteratee Function called with (element, key, collection)
*        for each element in $collection. The return value of $iteratee will
*        be used as the corresponding element in the returned array.
*
* @return array
*
* @example
	Dash\Collections\map(
		array(1, 2, 3),
		function($n) { return $n * 2; }
	) == array(2, 4, 6);
*
* @example
	Dash\Collections\map(
		array('roses' => 'red', 'violets' => 'blue'),
		function($color, $flower) { return $flower . ' are ' . $color; }
	) == array('roses' => 'roses are red', 'violets' => 'violets are blue');
*/
function mapValues($collection, $iteratee = 'Dash\\Functions\\identity')
{
    $mapped = array();
    $iteratee = property($iteratee);
    foreach ($collection as $key => $value) {
        $mapped[$key] = call_user_func($iteratee, $value, $key, $collection);
    }
    return $mapped;
}
    /**
     * @global KernelSettings $application
     */
    protected function render()
    {
        global $application, $controller;
        $prop = $this->props;
        if (!isset($prop->name)) {
            $prop->name = $prop->id;
        }
        $lang = property($prop, 'lang', $controller->lang);
        $lang = $lang === 'pt' ? 'pt_pt' : $lang;
        $addonURI = "{$application->addonsPath}/components/redactor";
        $autofocus = $prop->autofocus ? 'true' : 'false';
        $scriptsBaseURI = $application->framework;
        $initCode = <<<JAVASCRIPT
var redactorToolbar = ['html', 'formatting', 'bold', 'italic',
'unorderedlist', 'orderedlist', 'outdent', 'indent',
'image', 'video', 'file', 'table', 'link',
'fontcolor', 'backcolor',
'alignment',
'horizontalrule', 'fullscreen'];
JAVASCRIPT;
        $code = <<<JAVASCRIPT
\$(document).ready(
  function() {
    \$('#{$prop->id}_field').redactor({
      buttons: redactorToolbar,
      lang: '{$lang}',
      focus: {$autofocus},
      resize: false,
      autoresize: false,
      minHeight: 220,
      plugins: ['video', 'table', 'fullscreen', 'fontcolor', 'imagemanager', 'filemanager'],
      imageUpload: '{$scriptsBaseURI}/imageUpload.php',
      fileUpload: '{$scriptsBaseURI}/fileUpload.php',
      imageGetJson: '{$scriptsBaseURI}/gallery.php',
      imageManagerJson: '{$scriptsBaseURI}/gallery.php',
      imageInsertCallback: onInlineImageInsert
    });
  }
);
JAVASCRIPT;
        $this->context->getAssetsService()->addScript("{$addonURI}/redactor.min.js");
        $this->context->getAssetsService()->addScript("{$addonURI}/langs/{$lang}.js");
        $this->context->getAssetsService()->addStylesheet("{$addonURI}/css/redactor.css");
        $this->context->getAssetsService()->addScript("{$addonURI}/plugins/fontcolor.js");
        $this->context->getAssetsService()->addScript("{$addonURI}/plugins/video.js");
        $this->context->getAssetsService()->addScript("{$addonURI}/plugins/table.js");
        $this->context->getAssetsService()->addScript("{$addonURI}/plugins/fullscreen.js");
        $this->context->getAssetsService()->addScript("{$addonURI}/plugins/imagemanager.js");
        $this->context->getAssetsService()->addInlineScript($initCode, 'redactor');
        $this->context->getAssetsService()->addInlineScript($code);
        $this->tag('textarea', ['id' => $prop->id . "_field", 'name' => $prop->name], $prop->value);
    }
 protected function preRender()
 {
     $prop = $this->props;
     // Output a hidden checkbox that will submit an empty value if the visible checkbox is not checked.
     // Does not apply to checkboxes of array fields.
     if (exists($prop->name) && !str_endsWith($prop->name, '[]')) {
         echo "<input type=checkbox name=\"{$prop->name}\" value=\"\" checked style=\"display:none\">";
     }
     $id = property($prop, 'id');
     if ($id) {
         $prop->containerId = $prop->id . 'Container';
     }
     echo "<!--CHECKBOX-->";
     parent::preRender();
 }
Esempio n. 6
0
<?php

require_once dirname(__FILE__) . '/../_lib/tinyTinyFw.php';
$User = property('User')->take($UserId = property('User ID')->inherit($Id))->take($Username = property('Username')->must('maxLength', 255)->must('slug'))->take($UserPassword = property('Password')->inherit($Password));
 /**
  * Gets the raw value of the specified property, not performing data binding.
  *
  * @param string $propName
  * @param mixed  $default [optional]
  * @return mixed
  */
 function get($propName, $default = null)
 {
     return property($this, $propName, $default);
 }
 /**
  * @param int        $idx
  * @param Metadata[] $columns
  * @throws \Matisse\Exceptions\ComponentException
  */
 private function renderRow($idx, array $columns)
 {
     $this->begin('tr');
     $this->attr('class', 'R' . $idx % 2);
     if ($this->enableRowClick) {
         if ($this->isPropertySet('onClickGoTo')) {
             $onclick = $this->getComputedPropValue('onClickGoTo');
             $onclick = "selenia.go('{$onclick}',event)";
         } else {
             $onclick = $this->getComputedPropValue('onClick');
         }
         $onclick = "if (!\$(event.target).closest('[data-nck]').length) {$onclick}";
         $this->attr('onclick', $onclick);
     }
     if ($this->props->rowSelector) {
         $this->tag('td', ['class' => 'rh', 'data-nck' => true], $idx + 1);
     }
     foreach ($columns as $k => $col) {
         $col->preRun();
         $colAttrs = $col->props;
         $colType = property($colAttrs, 'type', '');
         $al = property($colAttrs, 'align');
         $isText = empty($colType);
         $this->begin('td');
         $this->attr('class', enum(' ', property($colAttrs, 'class'), "ta-{$al}", $colType == 'row-selector' ? 'rh' : '', $colType == 'field' ? 'field' : ''));
         if ($isText) {
             $this->beginContent();
             $col->runChildren();
         } else {
             if ($this->enableRowClick) {
                 $this->attr('data-nck');
             }
             $this->beginContent();
             $col->runChildren();
         }
         $this->end();
     }
     $this->end();
 }
Esempio n. 9
0
/**
* Gets the value at a path on a collection.
*
* @param array|object $collection
* @param string $path Path of the property to retrieve; can be nested by
*        delimiting each sub-property or array index with a period
* @param mixed $default Default value to return if nothing exists at $path
*
* @return mixed Value at $path on the collection
*
* @example
	$collection = array(
		'a' => array(
			'b' => 'value'
		)
	);
	Dash\Collections\get($collection, 'a.b') == 'value';
*
* @example Array elements can be referenced by index
	$collection = array(
		'people' => array(
			array('name' => 'Pete'),
			array('name' => 'John'),
			array('name' => 'Paul'),
		)
	);
	Dash\Collections\get($collection, 'people.1.name') == 'John';
*
* @example Keys with the same name as the full path can be used
	$collection = array('a.b.c' => 'value');
	Dash\Collections\get($collection, 'a.b.c') == 'value';
*/
function get($collection, $path, $default = null)
{
    $getter = property($path, $default);
    return call_user_func($getter, $collection);
}
Esempio n. 10
0
<meta name="ROBOTS" content="NONE" />
<meta name="MSSmartTagsPreventParsing" content="true" />
<meta name="Keywords"                  content="<?php 
echo property('app_keywords');
?>
" />
<meta name="Description"               content="<?php 
echo property('app_description');
?>
" />
<meta name="Copyright"                 content="<?php 
echo property('app_copyright');
?>
" />
<title><?php 
echo property('app_title');
?>
</title>
<?php 
echo style('menutab.css');
echo style('acordeon.css');
echo style('masonry.css');
echo style('estilos.css');
echo style('themes/proteo/proteo.css');
echo script('jquery-min.js');
echo script('jquery-migrate-min.js');
echo script('jquery-ui.custom.min.js');
echo script('plugins/myAccordion.js');
echo script('jquery.layout.js');
echo script('plugins/jquery.masonry.min.js');
echo script('jquery.dialogextend.min.js');
Esempio n. 11
0
echo $this->config->item('charset');
?>
" />
<meta http-equiv="Content-Language" content="es-es" />
<meta name="ROBOTS" content="NONE" />
<meta name="MSSmartTagsPreventParsing" content="true" />
<meta name="Keywords" content="<?php 
echo property('app_keywords');
?>
" />
<meta name="Description" content="<?php 
echo property('app_description');
?>
" />
<meta name="Copyright" content="<?php 
echo property('app_copyright');
?>
" />
<title>Men&uacute; <?php 
echo $this->datasis->traevalor('SISTEMA') . ' ' . $this->datasis->traevalor('EJERCICIO');
?>
</title>

<?php 
echo style("estilos.css");
//echo style("classic.css");
echo style("menutab.css");
echo style("acordeon.css");
echo style("masonry.css");
?>
Esempio n. 12
0
 /**
  * Do not call this. Set {@see autoId} instead.
  *
  * @return int New component ID.
  */
 protected function setAutoId()
 {
     if ($this->regenerateId || isset($this->props) && !property($this->props, 'id')) {
         $this->regenerateId = true;
         // if the component is re-rendered, always generate an id from now on.
         // Strip non alpha-numeric chars from generated name.
         $this->props->id = preg_replace('/\\W/', '', property($this->props, 'name') ?: lcfirst($this->className)) . $this->getUniqueId();
     }
     return $this->props->id;
 }
<?php

$Id = property('ID')->must('lessThanOrEqual', 50)->will('castInteger');
$Password = property('Password')->must('maxLength', 255)->must('slug');
Esempio n. 14
0
/**
* Gets the value at a path for all elements in a collection.
*
* @param array|object $collection
* @param string $path Path of the property to retrieve; can be nested by
*        delimiting each sub-property or array index with a period
*
* @return array
*
* @example
	Dash\Collections\pluck(
		array(
			array('a' => array('b' => 1)),
			array('a' => 'missing'),
			array('a' => array('b' => 3)),
			array('a' => array('b' => 4)),
		),
		'a.b',
		'default'
	) == array(1, 'default', 3, 4);
*/
function pluck($collection, $path, $default = null)
{
    return map($collection, property($path, $default));
}
 private function _yaml_clean($obj, $recurse = TRUE)
 {
     $o = new StdClass();
     foreach (get_object_vars($obj) as $k => $v) {
         if (in_array($k, $obj->fields)) {
             $o->{$k} = $obj->{$k};
         }
     }
     foreach (array_merge(property('belongs_to', $obj, array())) as $relationship) {
         if (is_a($obj->{$relationship}, $relationship)) {
             $o->{$relationship} = $this->_yaml_clean($obj->{$relationship}, false);
         } else {
             $o->{$relationship} = '';
         }
     }
     foreach (array_merge(property('has_many', $obj, array())) as $relationship) {
         if (is_array($obj->{$relationship})) {
             $a = $obj->{$relationship};
             #$class = get_class($a[1]);
             $class = get_class(current($a));
             $a = array();
             if ($recurse) {
                 foreach ($obj->{$relationship} as $oo) {
                     array_push($a, $this->_yaml_clean($oo, false));
                 }
                 $o->{$relationship} = $a;
             } else {
                 $o->{$relationship} = sizeof($obj->{$relationship}) . " {$class} Objects";
             }
         } else {
             $o->{$relationship} = '';
         }
     }
     return $o;
 }