Example #1
0
 $P = array('data' => $request);
 if (!Notify::errors()) {
     include __DIR__ . DS . 'task.ignite.substance.php';
     include __DIR__ . DS . 'task.fields.php';
     $header = array('Title' => $title, 'Link' => $link, 'Description' => trim($description) !== "" ? Text::parse(trim($description), '->encoded_json') : false, 'Author' => $author, 'Content Type' => Request::post('content_type', 'HTML'), 'Fields' => !empty($field) ? Text::parse($field, '->encoded_json') : false);
     $_ = POST . DS . $segment . DS . Date::slug($date) . '_' . implode(',', $kind) . '_' . $slug . $extension;
     // Ignite
     if (!$id) {
         Page::header($header)->content($content)->saveTo($_);
         if (!empty($css) && $css !== $config->defaults->{$segment . '_css'} || !empty($js) && $js !== $config->defaults->{$segment . '_js'}) {
             File::write(Converter::ES($css) . "\n\n" . SEPARATOR . "\n\n" . Converter::ES($js))->saveTo(CUSTOM . DS . Date::slug($date) . $extension);
             Weapon::fire(array('on_custom_update', 'on_custom_construct'), array($G, $P));
         }
         // Repair
     } else {
         Page::header($header)->content($content)->saveTo($post->path);
         File::open($post->path)->renameTo(File::B($_));
         $custom_ = CUSTOM . DS . Date::slug($post->date->W3C);
         if (file_exists($custom_ . $extension_o)) {
             Weapon::fire('on_custom_update', array($G, $P));
             if (trim(File::open($custom_ . $extension_o)->read()) === "" || trim(File::open($custom_ . $extension_o)->read()) === SEPARATOR || empty($css) && empty($js) || $css === $config->defaults->{$segment . '_css'} && $js === $config->defaults->{$segment . '_js'}) {
                 // Always delete empty custom CSS and JavaScript file(s) ...
                 File::open($custom_ . $extension_o)->delete();
                 Weapon::fire('on_custom_destruct', array($G, $P));
             } else {
                 File::write(Converter::ES($css) . "\n\n" . SEPARATOR . "\n\n" . Converter::ES($js))->saveTo($custom_ . $extension_o);
                 File::open($custom_ . $extension_o)->renameTo(Date::slug($date) . $extension);
                 Weapon::fire('on_custom_repair', array($G, $P));
             }
         } else {
             if (!empty($css) && $css !== $config->defaults->{$segment . '_css'} || !empty($js) && $js !== $config->defaults->{$segment . '_js'}) {
Example #2
0
<?php

//Obligatoire
$niveauSecu = 'log';
//Niveaux de sécurité (voir $session->authPage() )
include '../include/config.inc';
//TODO: rendre generique les inc.php ou .inc , par cq on prefereras les .inc.php
require_once 'config.inc.php';
$page = new Page();
$page->header('Système de paiement', 'buckutt');
?>
<link rel="stylesheet" type="text/css" href="<?php 
echo $config['baseUrl'];
?>
/fantomette/buckutt.style.css" />
<link type="text/css" href="css/flick/jquery-ui-1.8.4.custom.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery-1.4.2.min.js">
</script>
<script type="text/javascript" src="js/jquery-ui-1.8.4.custom.min.js">
</script>
<?php 
error_reporting(E_ERROR);
//$url = 'http://buckutt.dyndns.org/server/';
//TODO:rendre plus propre ca :
$url = $config['SERVER']['URL'];
// En fonction des pages, on appel ou non les wsdl utiles
//TODO: revoir avec le fichier de configuration
$wsdlSADMIN = $url . 'SADMIN.class.php?wsdl';
if ($needSBUY) {
    $wsdlSBUY = $url . 'SBUY.class.php?wsdl';
}
Example #3
0
$raiz = isset($raiz) ? $raiz : "../../../";
require_once $raiz . 'librerias/iMobile/Configuracion.cnf.php';
/**
 * Create a new Php object.
 */
$j = new Container();
/**
 * Config 'html' and 'head' tag.
 */
$j->head()->title('Examples');
/**
 * Create and config a page object.
 */
$p = new Page('examples');
$p->theme('b')->title('Examples');
$p->header()->theme('a');
$p->header()->addButton('Home', './', '', 'home');
//Get the Button Added and Set Attributes
$p->header()->items()->get(1)->attribute('data-iconpos', 'notext')->attribute('rel', 'external');
/**
 * Create and config a new listview object and add Items.
 */
$list1 = new Listview();
$list1->splitIcon('search')->splitTheme('c');
$list1->addDivider('Beginner', '2')->inset(true);
$list1->addBasic('Basic Example', 'example-1.php');
$list1->items()->get(1)->add('<a href="example-1.php" rel="external" target="_blank"></a>');
$list1->addBasic('Adding Pages', 'example-2.php');
$list1->items()->get(2)->add('<a href="example-2.php" rel="external" target="_blank"></a>');
$list1->addDivider('Intermediate', '3');
$list1->addBasic('Adding Objects', 'example-3.php');
Example #4
0
<?php

Weapon::fire('preview_before', array($P, $P));
$page = Page::header(array('Title' => Request::post('title', $speak->untitled . ' ' . date('Y/m/d H:i:s'), false), 'Content Type' => Request::post('content_type', 'HTML', false)))->content(Request::post('content', Config::speak('notify_empty', strtolower($speak->contents)), false))->read();
Weapon::fire('preview_title_before', array($P, $P));
echo '<h2 class="preview-title preview-article-title">' . $page['title'] . '</h2>';
Weapon::fire('preview_title_after', array($P, $P));
Weapon::fire('preview_content_before', array($P, $P));
echo '<div class="preview-content preview-article-content p">' . $page['content'] . '</div>';
Weapon::fire('preview_content_after', array($P, $P));
echo '</div>';
Weapon::fire('preview_after', array($P, $P));
Example #5
0
            Notify::error($speak->notify_invalid_email);
            Guardian::memorize($request);
        }
        $email = Text::parse($email, '->broken_entity');
        // Check for empty message content
        if (trim($message) === "") {
            Notify::error(Config::speak('notify_error_empty_field', $speak->message));
            Guardian::memorize($request);
        }
        $P = array('data' => $request);
        if (!Notify::errors()) {
            $header = array('Name' => $name, 'Email' => $email, 'URL' => $url, 'Status' => $request['status'], 'Content Type' => Request::post('content_type', 'HTML'), 'Fields' => !empty($field) ? Text::parse($field, '->encoded_json') : false);
            $_ = RESPONSE . DS . $segment . DS . Date::slug($request['post']) . '_' . Date::slug($rid) . '_' . ($request['parent'] ? Date::slug($request['parent']) : '0000-00-00-00-00-00') . $extension;
            // Ignite
            if (!$id) {
                Page::header($header)->content($message)->saveTo($_);
                // Repair
            } else {
                Page::open($response->path)->header($header)->content($message)->save();
                File::open($response->path)->renameTo(File::B($_));
            }
            Notify::success(Config::speak('notify_success_' . ($id ? 'updated' : 'created'), $speak->{$segment}) . ($extension === '.txt' ? ' <a class="pull-right" href="' . call_user_func('Get::' . $post . 'Anchor', $request['post'])->url . '#' . $segment . '-' . $rid . '" target="_blank"><i class="fa fa-eye"></i> ' . $speak->view . '</a>' : ""));
            Weapon::fire(array('on_' . $segment . '_update', 'on_' . $segment . '_' . ($id ? 'repair' : 'construct')), array($G, $P));
            Guardian::kick($config->manager->slug . '/' . $segment . '/repair/id:' . $rid . $config->url_query);
        }
    }
    Shield::lot(array('segment' => array($segment, $post)))->attach('manager');
});
/**
 * Response Killer
 * ---------------
 /**
  * Render shortcodes.
  *
  * @param  string     $content The content to render.
  * @param  array      $options Options to be passed to the renderer.
  * @param  null|Page  $page    Null or an instance of \Grav\Common\Page.
  *
  * @return string              The modified contents.
  */
 public function render($content, $options = [], $page = null)
 {
     // Build an anonymous function to pass to twig `render` method
     $function = function ($tag, $body, $arguments) use($options, $page) {
         if (isset($this->shortcodes[$tag])) {
             $options = isset($options[$tag]) ? $options[$tag] : [];
         }
         $event = new Event(['body' => $body, 'options' => new Data(array_replace_recursive($options, $arguments)), 'grav' => self::getGrav(), 'shortcodes' => $this, 'page' => $page, 'tag' => $tag]);
         return $event;
     };
     // Wrapper for shortcodes filter function
     $filter_function = function ($name, $content, $context, $env) {
         return $this->filterShortcode($name, $content, $context, $env);
     };
     // Process in-page shortcodes Twig
     $name = '@Shortcodes:' . $page->path();
     $this->loader->setTemplate($name, $content);
     $vars = ['__shortcodes' => $function, '__shortcodes_filter' => $filter_function];
     try {
         $page_default = $this->page;
         $this->page = $page;
         $output = $this->twig->render($name, $vars);
     } catch (\Twig_Error_Loader $e) {
         throw new \RuntimeException($e->getRawMessage(), 404, $e);
     }
     $shortcodes = isset($page->header()->shortcodes) ? $page->header()->shortcodes : [];
     if (isset($shortcodes['extra'])) {
         /** @var Cache $cache */
         $cache = self::getGrav()['cache'];
         $cache_id = md5('shortcodes' . $page->id() . $cache->getKey());
         $cache->save($cache_id, $shortcodes['extra']);
     }
     $this->page = $page_default;
     return $output;
 }
Example #7
0
 */
/**
 * Include the iMobile class.
 */
include '../lib/iMobile.php';
/**
 * Create a new Php object.
 */
$iMobile = new Php();
/**
 * Create a new page object.
 */
$p = new Page('simple-xml');
$p->theme('b');
$p->title('Cars');
$bt = $p->header()->addButton('', 'index.php', 'b', 'home', false, false, true);
$bt->rel('external')->attribute('data-iconpos', 'notext');
/**
 * Adding Listview to page.
 */
$lv = $p->addContent(new Listviem(), true);
$lv->filter(true);
/**
 * Reading XML;
 */
$xml = @simplexml_load_file('cars.xml') or die("error loading xml file.");
foreach ($xml->brandGroup as $brandGroup) {
    /**
     * Adding Dividers.
     */
    $lv->addDivider($brandGroup->name);
Example #8
0
 function __construct()
 {
     parent::__construct();
     $this->getData();
     parent::header('baseMVC - Delete "' . $this->title . '"');
 }
Example #9
0
/**
 * Example 2 - Adding Pages
 * @package iMobile
 * @filesource
 */
/**
 * Create a new Php object.
 */
$j = new Container();
/**
 * Create a new Page object and populate it
 */
$p = new Page('example-2');
$p->theme('b');
$p->title('Example 2');
$p->header()->addButton('Example 1', 'example-1.php', 'a', 'arrow-l');
$p->header()->addButton('Example 3', 'example-3.php', 'b', 'arrow-r');
$p->header()->theme('a');
$p->addContent('<h1>Adding Pages</h1>');
$p->addContent('<p>In this example we create a Page,');
$p->addContent(' add content and Buttons to the Header.');
$p->addContent(' After we add the page to Container object.</p>');
$p->addContent('<a href="index.php" data-role="button" data-theme="a">Home</a>');
$p->addContent('<a href="example-3.php" data-role="button">Example 3</a>');
$p->footer()->title('Example 2 Footer');
$p->footer()->position('fixed');
$p->footer()->theme('a');
/**
 * Add the page to Container object.
 */
$j->addPage($p);
Example #10
0
require 'config.php';
require PATH_ROOT . '/lib/class_page.php';
require PATH_ROOT . '/lib/class_login.php';
require PATH_ROOT . '/lib/class_imetos.php';
require PATH_ROOT . '/lib/class_station.php';
require PATH_ROOT . '/lib/class_sensor.php';
require PATH_ROOT . '/lib/class_config.php';
require PATH_ROOT . '/lib/class_ftp.php';
require PATH_ROOT . '/lib/class_users.php';
require PATH_ROOT . '/lib/class_reports.php';
require PATH_ROOT . '/lib/class_log.php';
//
require PATH_ROOT . '/lib/functions_standard.php';
require_once PATH_ROOT . '/lib/vendor/autoload.php';
$router = new \Klein\Klein();
Page::header();
// API Klein https://github.com/klein/klein.php/wiki/Api
//controllers
/*
$router->with('/users', function () use ($router) {
   $router->respond('GET', '/?', function ($request, $response) {
       // listado de todos los usuarios
       $_POST['action']='listUsers';
   });

   $router->respond('GET', '/[:userid]', function ($request, $response) {
       // Muestra solo un usuario
       $_POST['action']='listUser';
       if(isset($request->userid)) $_POST['userid']=$request->userid;
   });
   
Example #11
0
 function __construct()
 {
     parent::__construct();
     Page::header('baseMVC - Blog');
 }
Example #12
0
error_reporting(E_ALL);
ini_set('display_errors', '1');
$raiz = isset($raiz) ? $raiz : "../../../";
require_once $raiz . 'librerias/iMobile/Configuracion.cnf.php';
$j = new Container();
/**
 * Config 'html' and 'head' tag.
 */
$j->head()->title('Example 5');
/**
 * Create and config a page object.
 */
$p = new Page('example-5');
$p->theme('b')->title('Example 5');
$p->header()->theme('a')->add(new Button('', array(new Attribute('data-iconpos', 'notext')), array(), 'a', 'index.php', '', 'home'));
//Get the Button Added and Set Attributes
$p->header()->items()->get(1)->attribute('data-iconpos', 'notext')->attribute('rel', 'external');
/**
 * Create and config a new Navbar object and add items.
 */
$nav = $p->header()->add(new Navbar(), true);
$nav->add(new Button('', array(), array(), 'a', 'example-1.php', 'EX1', '', false));
$nav->add(new Button('', array(), array(), 'a', 'example-2.php', 'Ex2', '', false));
$nav->add(new Button('', array(), array(), 'a', 'example-3.php', 'EX3', '', false));
$nav->add(new Button('', array(), array(), 'a', 'example-4.php', 'EX4', '', false));
$nav->add(new Button('', array(), array(), 'a', '#', 'EX5', '', true));
/**
 * Configure page footer (Footer).
 */
$p->footer()->addButton('EX1', 'example-1.php', '', 'arrow-l');
Example #13
0
 function __construct()
 {
     parent::__construct();
     parent::header('baseMVC - ' . $_SESSION['fullname'] . ' - Manage Your Content');
 }
Example #14
0
 function getView()
 {
     $this->fetchData();
     Page::header('baseMVC - Edit "' . $this->article_data['title'] . '"');
     $this->view('edit_view', $this->article_data);
 }
Example #15
0
 $post = Date::format($article->time, 'Y-m-d-H-i-s');
 $id = (int) time();
 $parent = Request::post('parent');
 $P = array('data' => $request);
 $name = strip_tags($request['name']);
 $email = Text::parse($request['email'], '->broken_entity');
 $url = isset($request['url']) ? $request['url'] : false;
 $parser = strip_tags(Request::post('content_type', $config->html_parser));
 $message = $request['message'];
 $field = Request::post('fields', array());
 include DECK . DS . 'workers' . DS . 'task.field.1.php';
 // Temporarily disallow image(s) in comment to prevent XSS
 $message = strip_tags($message, '<br><img>' . ($parser === 'HTML' ? '<a><abbr><b><blockquote><code><del><dfn><em><i><ins><p><pre><span><strong><sub><sup><time><u><var>' : ""));
 $message = preg_replace('#(\\!\\[.*?\\]\\(.*?\\))#', '`$1`', $message);
 $message = preg_replace('#<img(\\s[^<>]*?)>#', '&lt;img$1&gt;', $message);
 Page::header(array('Name' => $name, 'Email' => $email, 'URL' => $url, 'Status' => Guardian::happy() ? 'pilot' : 'passenger', 'Content Type' => $parser, 'Fields' => !empty($field) ? Text::parse($field, '->encoded_json') : false, 'UA' => Get::UA(), 'IP' => Get::IP()))->content($message)->saveTo(RESPONSE . DS . $post . '_' . Date::format($id, 'Y-m-d-H-i-s') . '_' . ($parent ? Date::format($parent, 'Y-m-d-H-i-s') : '0000-00-00-00-00-00') . $extension);
 Notify::success(Config::speak('notify_success_submitted', $speak->comment));
 if ($extension === '.hold') {
     Notify::info($speak->notify_info_comment_moderation);
 }
 Weapon::fire('on_comment_update', array($P, $P));
 Weapon::fire('on_comment_construct', array($P, $P));
 if ($config->comment_notification_email) {
     $mail = '<p>' . Config::speak('comment_notification', $article->url . '#' . sprintf($comment_id, Date::format($id, 'U'))) . '</p>';
     $mail .= '<p><strong>' . $name . ':</strong></p>';
     $mail .= $parser !== 'HTML' ? Text::parse($message, '->html') : $message;
     $mail .= '<p>' . Date::format($id, 'Y/m/d H:i:s') . '</p>';
     // Sending email notification ...
     if (!Guardian::happy()) {
         if (Notify::send($request['email'], $config->author_email, $speak->comment_notification_subject, $mail, 'comment:')) {
             Weapon::fire('on_comment_notification_construct', array($request, $config->author_email, $speak->comment_notification_subject, $mail));
Example #16
0
 // Check for empty post content
 if (trim($content) === "") {
     Notify::error(Config::speak('notify_error__content_empty', strpos($speak->notify_error__content_empty, '%s') === 0 ? $speak->article : strtolower($speak->article)));
     Guardian::memorize($request);
 }
 $P = array('data' => $request, 'action' => $request['action']);
 if (!Notify::errors()) {
     include DECK . DS . 'workers' . DS . 'task.field.2.php';
     include DECK . DS . 'workers' . DS . 'task.field.1.php';
     include DECK . DS . 'workers' . DS . 'task.field.4.php';
     $task_connect_page = $article;
     $task_connect_page_css = $config->defaults->article_custom_css;
     $task_connect_page_js = $config->defaults->article_custom_js;
     // Ignite
     if (!$id) {
         Page::header($header)->content($content)->saveTo(ARTICLE . DS . Date::format($date, 'Y-m-d-H-i-s') . '_' . implode(',', $kind) . '_' . $slug . $extension);
         include DECK . DS . 'workers' . DS . 'task.custom.2.php';
         Notify::success(Config::speak('notify_success_created', $title) . ($extension === '.txt' ? ' <a class="pull-right" href="' . $config->url . '/' . $config->index->slug . '/' . $slug . '" target="_blank"><i class="fa fa-eye"></i> ' . $speak->view . '</a>' : ""));
         Weapon::fire('on_article_update', array($G, $P));
         Weapon::fire('on_article_construct', array($G, $P));
         Guardian::kick($config->manager->slug . '/article/repair/id:' . Date::format($date, 'U'));
         // Repair
     } else {
         Page::open($article->path)->header($header)->content($content)->save();
         File::open($article->path)->renameTo(Date::format($date, 'Y-m-d-H-i-s') . '_' . implode(',', $kind) . '_' . $slug . $extension);
         include DECK . DS . 'workers' . DS . 'task.custom.1.php';
         if ($article->slug !== $slug && ($php_file = File::exist(File::D($article->path) . DS . $article->slug . '.php'))) {
             File::open($php_file)->renameTo($slug . '.php');
         }
         Notify::success(Config::speak('notify_success_updated', $title) . ($extension === '.txt' ? ' <a class="pull-right" href="' . $config->url . '/' . $config->index->slug . '/' . $slug . '" target="_blank"><i class="fa fa-eye"></i> ' . $speak->view . '</a>' : ""));
         Weapon::fire('on_article_update', array($G, $P));
Example #17
0
 function do_comment_construct()
 {
     $config = Config::get();
     $speak = Config::speak();
     if ($config->page_type === 'article') {
         $comment_id = 'comment-%d';
         // Your comment ID
         $comment_form_id = 'comment-form';
         // Your comment form ID
         $article = isset($config->article->path) ? $config->article : false;
         $G = array('data' => array('article' => Mecha::A($article), 'comment_id' => $comment_id, 'comment_form_id' => $comment_form_id));
         if ($article !== false && ($request = Request::post())) {
             if ($task = File::exist(SHIELD . DS . $config->shield . DS . 'workers' . DS . 'task.comment.php')) {
                 require $task;
                 // Custom comment constructor
             } else {
                 // Check token
                 Guardian::checkToken($request['token'], $article->url . '#' . $comment_form_id);
                 $extension = $config->comments->moderation && !Guardian::happy() ? '.hold' : '.txt';
                 // Check name
                 if (trim($request['name']) === "") {
                     Notify::error(Config::speak('notify_error_empty_field', $speak->name));
                 }
                 // Check email
                 if (trim($request['email']) !== "") {
                     if (!Guardian::check($request['email'], '->email')) {
                         Notify::error($speak->notify_invalid_email);
                     } else {
                         // Disallow passenger(s) from entering your email address in the comment email field
                         if (!Guardian::happy() && $request['email'] === $config->author->email) {
                             Notify::warning(Config::speak('notify_warning_forbidden_input', array('<em>' . $request['email'] . '</em>', strtolower($speak->email))));
                         }
                     }
                 } else {
                     Notify::error(Config::speak('notify_error_empty_field', $speak->email));
                 }
                 // Check URL
                 if (trim($request['url']) !== "" && !Guardian::check($request['url'], '->url')) {
                     Notify::error($speak->notify_invalid_url);
                 }
                 // Check message
                 if (trim($request['message']) === "") {
                     Notify::error(Config::speak('notify_error_empty_field', $speak->message));
                 }
                 // Check challenge
                 if (!Guardian::checkMath($request['math'])) {
                     Notify::error($speak->notify_invalid_math_answer);
                 }
                 // Check name length
                 if (Guardian::check($request['name'], '->too_long', 100)) {
                     Notify::error(Config::speak('notify_error_too_long', $speak->name));
                 }
                 // Check email length
                 if (Guardian::check($request['email'], '->too_long', 100)) {
                     Notify::error(Config::speak('notify_error_too_long', $speak->email));
                 }
                 // Check URL length
                 if (Guardian::check($request['url'], '->too_long', 100)) {
                     Notify::error(Config::speak('notify_error_too_long', $speak->url));
                 }
                 // Check message length
                 if (Guardian::check($request['message'], '->too_long', 1700)) {
                     Notify::error(Config::speak('notify_error_too_long', $speak->message));
                 }
                 // Check for spam keyword(s) in comment
                 $fucking_words = explode(',', $config->keywords_spam);
                 foreach ($fucking_words as $spam) {
                     if ($f**k = trim($spam)) {
                         if ($request['email'] === $f**k || strpos(strtolower($request['message']), strtolower($f**k)) !== false) {
                             Notify::warning($speak->notify_warning_intruder_detected . ' <strong class="text-error pull-right">' . $f**k . '</strong>');
                             break;
                         }
                     }
                 }
                 if (!Notify::errors()) {
                     $post = Date::slug($article->time);
                     $id = (int) time();
                     $parent = Request::post('parent');
                     $P = array('data' => $request);
                     $P['data']['id'] = $id;
                     $name = strip_tags($request['name']);
                     $email = Text::parse($request['email'], '->broken_entity');
                     $url = isset($request['url']) && trim($request['url']) !== "" ? $request['url'] : false;
                     $parser = strip_tags(Request::post('content_type', $config->html_parser->active));
                     $message = Text::parse($request['message'], '->text', WISE_CELL . '<img>', false);
                     $field = Request::post('fields', array());
                     include File::D(__DIR__, 2) . DS . 'task.fields.php';
                     // Temporarily disallow image(s) in comment to prevent XSS
                     $message = preg_replace('#<img(\\s[^<>]*?)>#i', '&lt;img$1&gt;', $message);
                     Page::header(array('Name' => $name, 'Email' => $email, 'URL' => $url, 'Status' => Guardian::happy() ? 1 : 2, 'Content Type' => $parser, 'Fields' => !empty($field) ? Text::parse($field, '->encoded_json') : false))->content($message)->saveTo(COMMENT . DS . $post . '_' . Date::slug($id) . '_' . ($parent ? Date::slug($parent) : '0000-00-00-00-00-00') . $extension);
                     Notify::success(Config::speak('notify_success_submitted', $speak->comment));
                     if ($extension === '.hold') {
                         Notify::info($speak->notify_info_comment_moderation);
                     }
                     Weapon::fire(array('on_comment_update', 'on_comment_construct'), array($G, $P));
                     Guardian::kick($config->url_current . $config->ur_query . (!Guardian::happy() && $config->comments->moderation ? '#' . $comment_form_id : '#' . sprintf($comment_id, Date::format($id, 'U'))));
                 } else {
                     Guardian::kick($config->url_current . $config->url_query . '#' . $comment_form_id);
                 }
             }
         }
     }
 }
Example #18
0
 // Check for empty post content
 if (trim($content) === "") {
     Notify::error(Config::speak('notify_error__content_empty', strpos($speak->notify_error__content_empty, '%s') === 0 ? $speak->page : strtolower($speak->page)));
     Guardian::memorize($request);
 }
 $P = array('data' => $request, 'action' => $request['action']);
 if (!Notify::errors()) {
     include DECK . DS . 'workers' . DS . 'task.field.2.php';
     include DECK . DS . 'workers' . DS . 'task.field.1.php';
     include DECK . DS . 'workers' . DS . 'task.field.4.php';
     $task_connect_page = $page;
     $task_connect_page_css = $config->defaults->page_custom_css;
     $task_connect_page_js = $config->defaults->page_custom_js;
     // Ignite
     if (!$id) {
         Page::header($header)->content($content)->saveTo(PAGE . DS . Date::format($date, 'Y-m-d-H-i-s') . '__' . $slug . $extension);
         include DECK . DS . 'workers' . DS . 'task.custom.2.php';
         Notify::success(Config::speak('notify_success_created', $title) . ($extension === '.txt' ? ' <a class="pull-right" href="' . $config->url . '/' . $slug . '" target="_blank"><i class="fa fa-eye"></i> ' . $speak->view . '</a>' : ""));
         Weapon::fire('on_page_update', array($G, $P));
         Weapon::fire('on_page_construct', array($G, $P));
         Guardian::kick($config->manager->slug . '/page/repair/id:' . Date::format($date, 'U'));
         // Repair
     } else {
         Page::open($page->path)->header($header)->content($content)->save();
         File::open($page->path)->renameTo(Date::format($date, 'Y-m-d-H-i-s') . '__' . $slug . $extension);
         include DECK . DS . 'workers' . DS . 'task.custom.1.php';
         if ($page->slug !== $slug && ($php_file = File::exist(File::D($page->path) . DS . $page->slug . '.php'))) {
             File::open($php_file)->renameTo($slug . '.php');
         }
         Notify::success(Config::speak('notify_success_updated', $title) . ($extension === '.txt' ? ' <a class="pull-right" href="' . $config->url . '/' . $slug . '" target="_blank"><i class="fa fa-eye"></i> ' . $speak->view . '</a>' : ""));
         Weapon::fire('on_page_update', array($G, $P));
Example #19
0
$raiz = isset($raiz) ? $raiz : "../../../";
require_once $raiz . 'librerias/iMobile/Configuracion.cnf.php';
/**
 * Create a new Php object.
 */
$j = new Container();
/**
 * Config 'html' and 'head' tag.
 */
$j->head()->title('Example 4');
/**
 * Create and config a page object.
 */
$p = new Page('example-4');
$p->theme('b')->title('Example 4');
$p->header()->theme('a')->add(new Button('', array(new Attribute('data-iconpos', 'notext')), array(), 'a', 'index.php', '', 'home'));
/**
 * Create and config a new navbar object and add items.
 */
$nav = $p->header()->add(new Navbar(), true);
$nav->add(new Button('', array(), array(), 'a', 'example-1.php', 'EX1', '', false));
$nav->add(new Button('', array(), array(), 'a', 'example-2.php', 'Ex2', '', false));
$nav->add(new Button('', array(), array(), 'a', 'example-3.php', 'EX3', '', false));
$nav->add(new Button('', array(), array(), 'a', '#', 'EX4', '', true));
$nav->add(new Button('', array(), array(), 'a', 'example-5.php', 'EX5', '', false));
/**
 * Configure page footer (Footer).
 */
$p->footer()->addButton('EX1', 'example-1.php', '', 'arrow-l');
$p->footer()->addButton('EX2', 'example-2.php', '', 'arrow-l');
$p->footer()->addButton('EX3', 'example-3.php', '', 'arrow-l');
Example #20
0
<?php

Weapon::fire('preview_before', array($P, $P));
$comment = Page::header('Content Type', Request::post('content_type', 'HTML', false))->content(Request::post('message', Config::speak('notify_empty', strtolower($speak->messages)), false))->read('message', 'comment:');
Weapon::fire('preview_content_before', array($P, $P));
echo '<div class="preview-content preview-comment-content p">' . $comment['message'] . '</div>';
Weapon::fire('preview_content_after', array($P, $P));
Weapon::fire('preview_after', array($P, $P));