Esempio n. 1
0
 protected function loadTemplate()
 {
     $modal = new \Modal('edit-file-form');
     $this->template = new \Template();
     $this->template->setModuleTemplate('filecabinet', 'FC_Forms/folders.html');
     $this->template->add('modal', $modal->get());
 }
Esempio n. 2
0
 private function getModal()
 {
     $modal = new \Modal('folder-form');
     $modal->setWidthPercentage(30);
     $modal->addButton('<button class="btn btn-success save-element">' . _('Save') . '</button>');
     return $modal->get();
 }
Esempio n. 3
0
 public static function import()
 {
     $source_http = PHPWS_SOURCE_HTTP;
     $script = "<script src='{$source_http}mod/rss/javascript/feed.js'></script>";
     javascript('jquery');
     \Layout::addJSHeader($script);
     PHPWS_Core::requireConfig('rss');
     if (!ini_get('allow_url_fopen')) {
         $tpl['TITLE'] = dgettext('rss', 'Sorry');
         $tpl['CONTENT'] = dgettext('rss', 'You must enable allow_url_fopen in your php.ini file.');
         return $tpl;
     }
     PHPWS_Core::initCoreClass('DBPager.php');
     PHPWS_Core::initModClass('rss', 'Feed.php');
     $content = NULL;
     $template['ADD_LINK'] = '<button class="btn btn-success edit-feed"><i></i> Add Feed</button>';
     /*
      $vars['address'] = 'index.php?module=rss&command=add_feed';
      $vars['label'] = dgettext('rss', 'Add feed');
      $vars['width'] = '450';
      $vars['height'] = '350';
      $template['ADD_LINK'] = javascript('open_window', $vars);
     * 
     */
     $template['TITLE_LABEL'] = dgettext('rss', 'Title');
     $template['ADDRESS_LABEL'] = dgettext('rss', 'Address');
     $template['DISPLAY_LABEL'] = dgettext('rss', 'Display?');
     $template['ACTION_LABEL'] = dgettext('rss', 'Action');
     $template['REFRESH_TIME_LABEL'] = dgettext('rss', 'Refresh feed');
     $modal = new \Modal('rss-modal');
     $modal->addButton('<button class="btn btn-primary" id="save-feed"><i class="fa fa-save"></i> Save</button>');
     $modal_content = RSS_Admin::editFeed();
     $modal->setContent($modal_content);
     $modal->setTitle('Edit feed');
     $modal->setWidthPixel('400');
     $template['MODAL'] = $modal->get();
     $pager = new DBPager('rss_feeds', 'RSS_Feed');
     $pager->setModule('rss');
     $pager->setTemplate('admin_feeds.tpl');
     $pager->addPageTags($template);
     $pager->addRowTags('pagerTags');
     $content = $pager->get();
     $tpl['TITLE'] = dgettext('rss', 'Import RSS Feeds');
     $tpl['CONTENT'] = $content;
     if (!defined('ALLOW_CACHE_LITE') || !ALLOW_CACHE_LITE) {
         $tpl['MESSAGE'] = dgettext('rss', 'Please enable Cache Lite in your config/core/config.php file.');
     }
     return $tpl;
 }
Esempio n. 4
0
<?php

/**
 * @author Matthew McNaney <mcnaney at gmail dot com>
 */
if (Current_User::isLogged()) {
    $key = Key::getCurrent(true);
    if ($key) {
        $qr_func = function ($key_id, $size) {
            $qr = new QR($key_id);
            $qr->setSize($size);
            $image = $qr->get();
            return '<a download="QR-image.png" href="' . $qr->image . '">' . $qr->get() . '</a>';
        };
        $tpl_vars['small'] = $qr_func($key->id, 5);
        $tpl_vars['medium'] = $qr_func($key->id, 6);
        $tpl_vars['large'] = $qr_func($key->id, 8);
        $tpl_vars['xlarge'] = $qr_func($key->id, 12);
        $tpl = new \Template($tpl_vars);
        $tpl->setModuleTemplate('qr', 'modal.html');
        $content = $tpl->get();
        $modal = new Modal('qr-modal', $content, 'QR Codes (click to download)');
        $modal->sizeLarge();
        Layout::add($modal->get());
        MiniAdmin::add('qr', '<a data-toggle="modal" data-target="#qr-modal" class="pointer">Show QR codes</a>');
    }
}
Esempio n. 5
0
 public static function arrangeForm()
 {
     $vars['action'] = 'admin';
     $template['MOVE_BOXES'] = '<button class="btn btn-primary" id="move-boxes">Move boxes</button>';
     $template['MOVE_BOXES_DESC'] = dgettext('layout', 'Allows you to shift content to other area of your layout. Movement options depend on the current theme.');
     $vars['command'] = 'reset_boxes';
     $template['RESET_BOXES'] = PHPWS_Text::secureLink(dgettext('layout', 'Reset boxes'), 'layout', $vars, null, null, 'btn btn-primary');
     $template['RESET_DESC'] = dgettext('layout', 'Resets all content back to its original location. Use if problems with Box Move occurred.');
     $vars['command'] = 'clear_templates';
     $template['CLEAR_TEMPLATES'] = PHPWS_Text::secureLink(dgettext('layout', 'Clear templates'), 'layout', $vars, null, null, 'btn btn-primary');
     $template['CLEAR_TEMPLATES_DESC'] = dgettext('layout', 'Removes all files from the current template cache directory. Good to try if your theme is not displaying properly.');
     $vars['command'] = 'clear_cache';
     $template['CLEAR_CACHE'] = PHPWS_Text::secureLink(dgettext('layout', 'Clear cache'), 'layout', $vars, null, null, 'btn btn-primary');
     $template['CLEAR_CACHE_DESC'] = dgettext('layout', 'Clears all Cache Lite files. Good to try if module updates do not display.');
     javascript('jquery');
     $script = '<script type="text/javascript" src="' . PHPWS_SOURCE_HTTP . 'mod/layout/javascript/move_boxes.js"></script>';
     \Layout::addJSHeader($script, 'moveboxes');
     $modal = new \Modal('box-move', '', 'Move boxes');
     $modal->sizeLarge();
     $template['MODAL'] = $modal->get();
     return PHPWS_Template::process($template, 'layout', 'arrange.tpl');
 }