THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
////////////////////////////////////////////////////////////////////////////////////////////////////////// */
HtmlBuilder::start_view_block('head', '', '', '');
$this->insert_meta_tag(array('http-equiv' => "content-type", 'content' => "text/html; charset=UTF-8"));
$this->insert_meta_tag(array('charset' => "utf-8"));
$this->insert_meta_tag(array('name' => "generator", 'content' => "Bootply"));
$this->insert_meta_tag(array('name' => "viewport", 'content' => "width=device-width, initial-scale=1, " . "maximum-scale=1"));
$this->insert_jscript("jquery-1.11.3.min.js");
$this->insert_jscript("bootstrap.min.js");
//$this->insert_jscript("fader.js");
$this->insert_css("bootstrap.min.css");
$this->insert_css("styles.css");
$this->insert_css("carousel.css");
?>
           
 
 <?php 
HtmlBuilder::insert_html_tag('title', '', '', '', DEFAULT_HOSTNAME);
Navbar::init();
Navbar::insert_navbar(DEFAULT_HOSTNAME, '#');
HtmlBuilder::end_view_block('head');
HtmlBuilder::start_view_block('body', '', '', '');
Components::insert_carousel_block();
HtmlBuilder::start_view_block('div', '', 'container', '');
?>
       
 private function handle_upload()
 {
     $id = null;
     if (isset($_FILES['Filedata']) && !empty($_FILES['Filedata']['tmp_name']) && !empty($_POST['title'])) {
         $FileAPI = new FileAPI(array('pdf'));
         try {
             $imported_filename = $FileAPI->import($_FILES['Filedata']['tmp_name'], $_FILES['Filedata']['name']);
             //Upload war erfolgreich und die Datei wurde korrekt abgelegt.
             //$id = YumpuEpaper_repository::create($imported_filename, $_POST['title']);
             $status = "success";
         } catch (FileAPI_exception $e) {
             $status = "error";
             $message = $e->getMessage();
         } catch (YumpuEpaper_repository_exception $e) {
             /**
              * Wenn möglich sollten wir die importierte Datei direkt entfernen.
              */
             $FileAPI->delete($_FILES['yc_file']['name']);
             $status = "error";
             $message = $e->getMessage();
         }
     } else {
         $status = "error";
         $message = "no input file";
     }
     $upload_response = json_encode(array('status' => $status, 'message' => $message, 'id' => $id, 'filename' => addslashes($imported_filename)));
     $HB = new HtmlBuilder('admin_upload_response.php', $this->plugin_path . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR);
     $HB->assign('upload_response', $upload_response);
     echo $HB->get_data();
 }
 public function buildHtml(&$params)
 {
     $url = parent::getUrl($params, $this->baseUrl);
     $html = parent::getIFrameBegin($params);
     if ($params->isLink() == 1) {
         $url .= "?key=" . $params->getEmbedAPIKey();
         $url .= "&q=" . urlencode($params->getAddress());
         $url .= "&zoom=" . $params->getZoomLevel();
         $url .= "&maptype=" . $this->getMapType($params->getMapType());
         if (strcmp($params->getLanguage(), '-') != 0) {
             $url .= "&language=" . $params->getLanguage();
         }
     }
     if ($params->isLink() == 0 && $params->isGoogleMapsEngine() == 1) {
         $html .= "src='{$url}&output=embed'></iframe>\n";
     } else {
         $html .= "src='{$url}'></iframe>\n";
     }
     if ($params->getAddLink() == 0) {
         if ($params->isGoogleMapsEngine() == 0) {
             $url = str_replace('/embed', '/viewer', $url);
             $html .= parent::getLinkHtml($url, $params->getLinkLabel());
         } else {
             if ($params->isLink() == 0) {
                 $html .= parent::getLinkHtml($url, $params->getLinkLabel());
             }
         }
     }
     return $html;
 }
Exemple #4
0
 public function buildHtml(&$params)
 {
     $url = parent::getUrl($params, $this->baseUrl);
     $html = parent::getIFrameBegin($params);
     if ($params->isLink() == 1) {
         $url .= "?q=" . $params->getAddress();
     }
     if ($params->isGoogleMapsEngine() == 1) {
         $url .= "&z=" . $params->getZoomLevel();
         $url .= "&t=" . $this->getMapType($params->getMapType());
         if (strcmp($params->getLanguage(), '-') != 0) {
             $url .= "&hl=" . $params->getLanguage();
         }
     }
     $html .= "src='{$url}&output=embed'></iframe>\n";
     if ($params->getAddLink() == 0) {
         if ($params->isGoogleMapsEngine() == 0) {
             $url = str_replace('/embed', '/viewer', $url);
         } else {
             if ($params->isLink() == 1) {
                 $url = str_replace('/maps', '/maps/preview', $url);
             }
         }
         $html .= parent::getLinkHtml($url, $params->getLinkLabel());
     }
     return $html;
 }
Exemple #5
0
 /**
  * HtmlParser constructor
  *
  * @param string $source
  * @param string $type
  */
 public function __construct($source, $type = 'url')
 {
     //supress warnings for poorly formated html
     libxml_use_internal_errors(true);
     //Load the html based on type
     $this->htmlcode = HtmlBuilder::build($source, $type);
     $this->htmlcode = mb_convert_encoding($this->htmlcode, 'HTML-ENTITIES', "UTF-8");
     $this->dom = new DOMDocument();
     $this->dom->loadHTML($this->htmlcode);
 }
 public function buildHtml(&$params)
 {
     $url = parent::getUrl($params, $this->baseUrl);
     $html = parent::getIFrameBegin($params);
     if ($params->isLink() == 1) {
         $url .= "?q=" . $params->getAddress();
         if (strlen($params->getInfoLabel()) > 0) {
             $url .= "(" . $params->getInfoLabel() . ")";
         }
     }
     if ($params->isGoogleMapsEngine() == 1) {
         $url .= "&z=" . $params->getZoomLevel();
         $url .= "&t=" . $params->getMapType();
         if (strcmp($params->getLanguage(), '-') != 0) {
             $url .= "&hl=" . $params->getLanguage();
         }
         $info = $params->getShowInfo() == 0 ? "" : "&iwloc=near";
         // Unicode properties are available only if PCRE is compiled with "--enable-unicode-properties"
         // '\pL' = any Unicode letter
         if (preg_match('/^[^\\pL]+$/u', $params->getAddress())) {
             $info = $params->getShowInfo() == 0 ? "&iwloc=near" : "";
         }
         $url .= $info;
     }
     $html .= "src='{$url}&output=svembed'></iframe>\n";
     if ($params->getAddLink() == 0) {
         $output = $params->getLinkFull() == 0 ? "&output=svembed" : "&output=classic";
         if ($params->isGoogleMapsEngine() == 0) {
             $url = str_replace('/embed', '/viewer', $url);
         } else {
             $url .= $output;
         }
         $html .= parent::getLinkHtml($url, $params->getLinkLabel());
     }
     return $html;
 }
 private function display()
 {
     if (WP_Yumpu::$API_TOKEN === null) {
         echo '';
         return;
     }
     $HB = new HtmlBuilder('admin_files.php', $this->plugin_path . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR);
     $yumpu_action = isset($_REQUEST['yumpu_action']) ? $_REQUEST['yumpu_action'] : null;
     switch ($yumpu_action) {
         case "create_epaper":
             if (isset($_FILES['yc_file']) && !empty($_FILES['yc_file']['tmp_name']) && !empty($_POST['yc_title'])) {
                 $FileAPI = new FileAPI(array('pdf'));
                 try {
                     $imported_filename = $FileAPI->import($_FILES['yc_file']['tmp_name'], $_FILES['yc_file']['name']);
                     //Upload war erfolgreich und die Datei wurde korrekt abgelegt.
                     YumpuEpaper_repository::create($imported_filename, $_POST['yc_title'], $_POST['yc_description']);
                     $HB->assign('yumpu_success_message', 'upload successfull');
                 } catch (FileAPI_exception $e) {
                     $HB->assign('yumpu_error_message', $e->getMessage());
                 } catch (YumpuEpaper_repository_exception $e) {
                     /**
                      * Wenn möglich sollten wir die importierte Datei direkt entfernen.
                      */
                     $FileAPI->delete($_FILES['yc_file']['name']);
                     $HB->assign('yumpu_error_message', $e->getMessage());
                 }
             } else {
                 $HB->assign('yumpu_error_message', 'no input file or title missing');
             }
             break;
     }
     /**
      * Hier Liste der gesmaten Dokumenten auflisten.
      */
     $ePapers = YumpuEpaper_repository::getAll();
     $HB->assign('epapers', $ePapers);
     echo $HB->get_data();
 }
 public function __construct($content = [], $template_file = null, $options = [])
 {
     // Load the specified template, or the default navbar template
     if ($template_file) {
         parent::__construct($content, $template_file, $options);
     } else {
         parent::__construct($content, null, $options);
         $this->setTemplate("<option class='{{_css_classes}}' value='{{_item_value}}' {{_data}} {{_selected}}>{{_label}}</option>");
     }
     if (isset($content['@item_value'])) {
         $this->itemValue($content['@item_value']);
     }
     if (isset($content['@label'])) {
         $this->label($content['@label']);
     }
     if (isset($content['@title'])) {
         $this->title($content['@title']);
     }
     if (isset($content['@selected'])) {
         $this->selected($content['@selected']);
     }
     if (isset($content['@data'])) {
         $this->dataAttributes($content['@data']);
     }
     if (isset($content['@css_classes'])) {
         $this->cssClasses($content['@css_classes']);
     }
 }
Exemple #9
0
 public static function generate_fader_block($top_image, $picture_array)
 {
     HtmlBuilder::start_view_block('div', 'fader', '', '');
     HtmlBuilder::insert_image($top_image, 'top image', 'active');
     foreach ($picture_array as $key => $val) {
         HtmlBuilder::insert_image($val, $key, '');
     }
     HtmlBuilder::end_view_block('div');
 }
Exemple #10
0
<?php

/* ///////////////////////////////////////////////////////////////////////////////////////////////////////////
Copyright (c) June 28, 2015. Christopher M Koivu.


Permission is hereby granted, free of charge, to any person obtaining a copy of 
this software and associated documentation files (the "Software"), the rights to 
use, copy, modify, merge, publish, or distribute copies of the Software, and to 
permit persons to whom the Software is furnished to do so, subject to the 
following conditions:

The above copyright notice and this permission notice shall be included in all 
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
////////////////////////////////////////////////////////////////////////////////////////////////////////// */
HtmlBuilder::insert_error_panel();
?>

</div> <!-- end container -->



</body>
</html>
Exemple #11
0
 /**
  *	Format Code 
  *
  *	@param Array $lines - The lines of code to display
  *	@param Int $errorLine - The line of the error
  *	@param
  *	@return String - Formatted Code
  */
 private function formatCode($lines, $errorLine)
 {
     $return = "";
     //Find Minimum Tab Count At Start Of Line
     $tabRemoveCount = null;
     foreach ($lines as $line => $loc) {
         if (!empty($loc)) {
             $currentTabCount = strspn($loc, "\t");
             if ($currentTabCount < $tabRemoveCount || is_null($tabRemoveCount)) {
                 $tabRemoveCount = $currentTabCount;
             }
         }
     }
     //Format Lines
     foreach ($lines as $line => $loc) {
         $loc = substr($loc, strlen(str_repeat("\t", $tabRemoveCount)), strlen($loc));
         if ($line == $errorLine) {
             $return .= HtmlBuilder::make_r("strong", $line . "| " . $loc) . "\n";
         } else {
             $return .= $line . "| " . HtmlBuilder::make_r("em", $loc) . "\n";
         }
     }
     //RETURN PREFORAMATTED.
     return '<pre style="margin:0">' . $return . '</pre>';
 }
Exemple #12
0

Permission is hereby granted, free of charge, to any person obtaining a copy of 
this software and associated documentation files (the "Software"), the rights to 
use, copy, modify, merge, publish, or distribute copies of the Software, and to 
permit persons to whom the Software is furnished to do so, subject to the 
following conditions:

The above copyright notice and this permission notice shall be included in all 
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
////////////////////////////////////////////////////////////////////////////////////////////////////////// */
include $this->header;
HtmlBuilder::start_view_block('div', '', 'jumbotron', '');
HtmlBuilder::insert_html_tag('h2', '', '', '', $this->get('act_heading'));
HtmlBuilder::insert_html_tag('pgraph', '', '', '', $this->get('output'));
HtmlBuilder::start_view_block('div', '', 'jumbotron', '');
HtmlBuilder::insert_link($this->get('button_link'), '', 'btn btn-info btn-lg', '', '');
Components::insert_glyphicon($this->get('glyph_name'), ' ' . $this->get('button_text'));
HtmlBuilder::end_view_block('a');
HtmlBuilder::end_view_block('div');
include $this->footer;
?>
  
       
Exemple #13
0
 private function parseContent($placeholder, $content)
 {
     $result = "";
     // If child is an HtmlBuilder object, just add it
     if (is_a($content, "Bootsole\\HtmlBuilder")) {
         $result = $content;
         // If it is an array, then attempt to load a template specified by @source or @template and construct a new HtmlBuilder object
     } else {
         if (is_array($content)) {
             $result = [];
             // Load template, if specified
             if (isset($content['@source'])) {
                 // read in source template
                 $child_template = $this->loadTemplate($content['@source']);
             } else {
                 if (isset($content['@template'])) {
                     $child_template = $content['@template'];
                 }
             }
             // Array must have a '@content' or '@array' field, or be an array of HtmlBuilder objects.
             if (isset($content['@content'])) {
                 // Simple content fields
                 $hb = new HtmlBuilder($content['@content']);
                 $hb->setTemplate($child_template);
                 $result = $hb;
             } else {
                 if (isset($content['@array'])) {
                     // Loop through array, creating new HtmlBuilder for each element.  They will be concatenated upon rendering.
                     $result = [];
                     foreach ($content['@array'] as $i => $row) {
                         $hb = new HtmlBuilder($row);
                         $hb->setTemplate($child_template);
                         $result[] = $hb;
                     }
                     return $result;
                 } else {
                     // Check that every element is an HtmlBuilder object.  They will be concatenated upon rendering.
                     foreach ($content as $i => $row) {
                         if (!is_a($row, "Bootsole\\HtmlBuilder")) {
                             throw new \Exception("The array assigned to placeholder '{$placeholder}' must contain a '@content' or '@array' field, or be an array of HtmlBuilder objects.");
                         }
                     }
                     $result = $content;
                     return $result;
                 }
             }
             // If it is a scalar, just add it
         } else {
             if (is_scalar($content)) {
                 $result = $content;
                 // Otherwise throw an exception
             } else {
                 throw new \Exception("The contents of '{$placeholder}' must be a scalar value, HtmlBuilder object, or subarray.");
             }
         }
     }
     return $result;
 }
 /**
  * Convert this object to string.
  *
  * @return  string
  */
 public function __toString()
 {
     return HtmlBuilder::create($this->name, $this->content, $this->attribs);
 }
 public function render()
 {
     if ($this->_sorter) {
         $this->setContent('_sorter', "sorter-{$this->_sorter}");
     } else {
         $this->setContent('_sorter', "");
     }
     $this->setContent('_label', $this->_label);
     return parent::render();
 }
 private function display()
 {
     $HB = new HtmlBuilder('admin_settings.php', $this->plugin_path . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR);
     $HB->assign('API_TOKEN', WP_Yumpu::$API_TOKEN);
     echo $HB->get_data();
 }
<?php

namespace Builder\my;

require_once __DIR__ . '/../autoload.php';
/** @var array $argv */
if (1 === count($argv)) {
    usage();
    exit;
} elseif ($argv[1] === 'plain') {
    $textBuilder = new TextBuilder();
    (new Director($textBuilder))->construct();
    echo $textBuilder->getResult(), PHP_EOL;
} elseif ($argv[1] === 'html') {
    $htmlBuilder = new HtmlBuilder();
    (new Director($htmlBuilder))->construct();
    echo $htmlBuilder->getResult(), PHP_EOL;
} else {
    usage();
}
function usage()
{
    echo 'Usage: php builder.php plain -- Create plain text document', PHP_EOL;
    echo 'Usage: php builder.php html -- Create html document', PHP_EOL;
}
Exemple #18
0
 /**
  * renders view into a webpage
  * @throws Exception if include file (header or footer) are not found
  */
 public function render()
 {
     if (!file_exists($this->file)) {
         throw new Exception("View file: " . $this->file . " doesn't exist.");
     }
     //output to buffer for rendering
     extract($this->data);
     ob_start();
     include $this->file;
     $output = ob_get_contents();
     HtmlBuilder::insert_error_panel();
     ob_end_clean();
     echo $output;
 }
permit persons to whom the Software is furnished to do so, subject to the 
following conditions:

The above copyright notice and this permission notice shall be included in all 
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
////////////////////////////////////////////////////////////////////////////////////////////////////////// */
include $this->header;
//start_view_block($tagName, $id=NULL, $class=NULL, $style=NULL)
HtmlBuilder::insert_html_tag('h3', '', '', '', 'Please enter new password');
HtmlBuilder::start_form('users', 'reset_password', 'post');
// if ($this->get('show_textbox'))
//  {
HtmlBuilder::insert_form_input('password', 'password', '', 'position: relative; left: 85px;top: 5px;');
HtmlBuilder::insert_form_input('password', 'confirm_password', '', 'position: relative; left: 25px;top: 5px;');
//   }
HtmlBuilder::insert_html_tag('pgraph');
/* insert twitter-bootstrap submit button */
HtmlBuilder::insert_button("submit", "btn btn-primary", "submit", "Submit");
HtmlBuilder::start_view_block('p', '', '', '');
HtmlBuilder::insert_link('', '', '', '', 'Cancel');
HtmlBuilder::end_view_block('p');
/* end of login form */
HtmlBuilder::end_view_block('form');
include $this->footer;
 public function render()
 {
     // 'Hidden' items are simply not rendered at all
     if ($this->_display == "hidden") {
         return "";
     }
     $this->setContent('_label', $this->_label);
     $this->setContent('_url', $this->_url);
     $this->setContent('_active', $this->_active ? "active" : "");
     $this->setContent('_display', $this->_display == "disabled" ? "disabled" : "");
     $this->setContent('_css_classes', $this->renderCssClasses());
     $this->setContent('_data', $this->renderDataAttributes());
     return parent::render();
 }
Exemple #21
0
 public function render()
 {
     $this->setContent('_align', $this->_align);
     $this->setContent('_css_classes', $this->renderCssClasses());
     $this->setContent('_data', $this->renderDataAttributes());
     return parent::render();
 }
Exemple #22
0
 public function render()
 {
     if (defined('Bootsole\\URI_JS_ROOT')) {
         $site_path = URI_JS_ROOT;
     } else {
         $site_path = "";
     }
     $this->_content['_js_includes'] = "";
     // Ok, either load list of JS files if JS_DEV is enabled, or the minified JS file if we are in production mode
     if (!defined('Bootsole\\JS_DEV') || JS_DEV) {
         foreach ($this->_js_includes['js'] as $include) {
             $this->_content['_js_includes'] .= "<script src='{$site_path}{$include}'></script>\n";
         }
     } else {
         $this->_content['_js_includes'] .= "<script src='{$site_path}{$this->_js_includes['min_js']}'></script>\n";
     }
     return parent::render();
 }