public function toHtml()
 {
     $topPanel = new TopPanelControl(null, 'debugTopPanel');
     $topPanel->setCaption('
             <div class="debug-block">
                 <span class="glyphicon glyphicon-flash"></span> &nbsp;&nbsp;' . QueryLog::count() . '
             </div>
             <div class="debug-block">
                 <span class="glyphicon glyphicon-time"></span> &nbsp;&nbsp;' . Profiler::getTotalTime() . ' ms
             </div>
             <div class="debug-block">
                 <span class="glyphicon glyphicon-oil"></span> &nbsp;&nbsp;' . round(memory_get_peak_usage() / 1024 / 1024, 1) . ' MB
             </div>
             ')->setOpened(Logging::isError());
     if ($this->mode === self::MODE_LARGE) {
         $tabControl = new TabControl(null, 'debugTabControl');
         $tabControl->addTab('Log (' . count(Logging::getLogItems()) . ')')->add($this->showLog());
         $tabControl->addTab('SQL-Queries (' . QueryLog::count() . ')')->add($this->showQueryLog());
         $tabControl->addTab('Request')->add($this->showNfsRequest());
         $tabControl->addTab('REQUEST-Array (' . count($_REQUEST) . ')')->add($this->showRequest());
         if (Configuration::get('logging.showServerVar') === 'true') {
             $tabControl->addTab('SERVER-Array (' . count($_SERVER) . ')')->add($this->showServer());
         }
         $tabControl->addTab('FILES-Array (' . count($_FILES) . ')')->add($this->showFiles());
         $tabControl->addTab('Profiler')->add($this->showProfilerInfo());
         $tabControl->addTab('Cache')->add($this->showTabInfo());
         $tabControl->addTab('Debug')->add($this->showDebugTab());
         $topPanel->add($tabControl);
     }
     Javascript::addJs($topPanel->getJavascript());
     return $topPanel->toHtml();
 }
 /**
  * @inheritdoc
  */
 public function toHtml()
 {
     if (count(Routing::getBreadcrumbs()) === 0) {
         return '';
     }
     $ul = Html::create($this->tagToUse)->addCssClasses($this->cssClasses)->css('breadcrumb');
     $lastLi = null;
     foreach (Routing::getBreadcrumbs() as $curBreadcrumb) {
         $li = Html::create('li')->addTo($ul);
         $fulllink = $curBreadcrumb['link'];
         if (strpos($fulllink, 'http') === false) {
             $fulllink = Configuration::get('site.scriptUrl') . $fulllink;
         }
         $text = $curBreadcrumb['text'];
         if (mb_strlen($curBreadcrumb['text']) > 20) {
             $text = mb_substr($curBreadcrumb['text'], 0, 20) . '...';
         }
         if ($curBreadcrumb['link'] !== '') {
             Html::create('a')->addTo($li)->attr('href', $fulllink)->attr('title', $curBreadcrumb['text'])->text($text);
         } else {
             Html::create('span')->addTo($li)->attr('title', $curBreadcrumb['text'])->text($text);
         }
         $lastLi = $li;
     }
     $lastLi->css('active');
     return $ul->render();
 }
 /**
  * @covers \NewFrontiers\Framework\Output\Javascript::registerLibrary
  * @covers \NewFrontiers\Framework\Output\Javascript::requireLibrary
  * @covers \NewFrontiers\Framework\Output\Javascript::includeRequiredLibraries
  * @covers \NewFrontiers\Framework\Output\Javascript::includeRegisteredLibrary
  * @covers \NewFrontiers\Framework\Output\Javascript::getInstance
  */
 public function testExternalLibrary()
 {
     Javascript::requireLibrary("nfs.StdControls");
     Javascript::requireLibrary("nfs.ExtControls");
     Javascript::requireLibrary("nfs.DataControls");
     Javascript::requireLibrary("jQuery");
     Javascript::requireLibrary("datetimepicker");
     Javascript::requireLibrary("magnific");
     Javascript::requireLibrary("typeahead");
     Javascript::requireLibrary("googlemaps");
     Javascript::requireLibrary("jqueryuploader");
     Javascript::requireLibrary("ckeditor");
     Javascript::requireLibrary("bootstrap-toggle");
     Javascript::requireLibrary("bootstrap-star-rating");
     Javascript::requireLibrary("code-prettify");
     Javascript::requireLibrary("bootstrap-slider");
     Javascript::requireLibrary("chosen");
     Javascript::requireLibrary("froala");
     Javascript::requireLibrary("Chart.js");
     $string = $this->getActualOutput();
     $this->assertEmpty($string);
     //Read test configuration for full path
     Configuration::getInstance()->readConfig();
     Javascript::includeRequiredLibraries();
     $this->expectOutputRegex('/.*(script)+.*/');
     //check that valid html is produced
     $html = $this->getActualOutput();
     $this->assertNotEmpty($html);
     $dom = new \DOMDocument();
     $dom->validateOnParse = true;
     $isValid = $dom->loadHTML($html);
     $this->assertTrue($isValid);
     /* now follows a quite complex way to check if all URLs are parsable and if all
      * scripts that are not located on localhost are accessible. The complex thing
      * about this is to check scheme-relative URLs. For example //domain.de */
     $URL_string = preg_replace('(.*src\\=\\"|\\".*)', "", $html);
     $URL_array = explode("\n", $URL_string);
     foreach ($URL_array as $URL) {
         if (!empty($URL)) {
             $parsed = parse_url($URL);
             if ($parsed === false) {
                 $this->fail("Malformed URL: {$URL}");
                 continue;
             }
             if (isset($parsed['host']) && $parsed['host'] != "localhost") {
                 if (empty($parsed['scheme'])) {
                     $httpURL = 'http://' . ltrim($URL, '/');
                     $headers = @get_headers($httpURL);
                     if (!$headers && strpos($headers[0], '200') !== false) {
                         $httpsURL = 'https://' . ltrim($URL, '/');
                         $headers = @get_headers($httpsURL);
                     }
                 } else {
                     $headers = @get_headers($URL);
                 }
                 $this->assertTrue($headers && strpos($headers[0], '200') !== false, "Script not found: {$URL}");
             }
         }
     }
 }
 public function toJavascript()
 {
     $key = Configuration::get('googleanalytics.key', null);
     $domain = Configuration::get('googleanalytics.domain', null);
     if ($key == null) {
         throw new Exception('Google Analytics Key/Domain wurde in der Config nicht festgelegt');
     }
     return "\n\n                (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n                    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n          })(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n\n          ga('create', '{$key}', '{$domain}');\n          ga('send', 'pageview');\n\n        ";
 }
 function __construct(Kollektion $kollektion, $options = null, $initialize = true, $error_messages = null)
 {
     $this->kollektionId = $kollektion->id;
     $this->options = array('user_dirs' => true, 'upload_dir' => 'medien/', 'upload_url' => Configuration::get('site.internalUrl') . '/medien/', 'image_versions' => array('thumbs' => array('crop' => true, 'max_width' => 140, 'max_height' => 140), 'resized' => array('max_width' => 1024, 'max_height' => 1024)));
     if ($options) {
         $this->options = $options + $this->options;
     }
     parent::__construct($this->options, $initialize, $error_messages);
 }
 /**
  * @inheritdoc
  */
 public function toJavascript()
 {
     return "\$('#{$this->id}').froalaEditor()";
     $path = Configuration::get('site.url');
     if ($this->toolbar === self::TOOLBAR_SMALL) {
         return "\n            \n                    var editor = CKEDITOR.instances['{$this->id}'];\n                    if (editor) { editor.destroy(true); }\n    \n                    var {$this->id}_editor = CKEDITOR.replace( '{$this->id}', {toolbar: [\n                    ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],\n                    ['NumberedList','BulletedList']\n                    ]});    \n\n                    CKFinder.setupCKEditor( {$this->id}_editor, '{$path}/lib/ckfinder/');\n                    CKEDITOR.config.height = '200px';";
     } else {
         return "\n            \n                    var editor = CKEDITOR.instances['{$this->id}'];\n                    if (editor) { editor.destroy(true); }\n    \n                    var {$this->id}_editor = CKEDITOR.replace( '{$this->id}', {\n                            height : '400px',\n                            extraPlugins : 'templates',\n                            toolbar: [\n                              ['Source','-','Templates'],\n                              ['Cut','Copy','Paste','PasteText','PasteFromWord'],\n                              ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],\n                              '/',\n                              ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],\n                              ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote','CreateDiv'],\n                              ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],\n                              ['Link','Unlink','Anchor'],\n                              ['Image','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'],\n                              '/',\n                              ['Styles','Format','Font','FontSize'],\n                              ['TextColor','BGColor'],\n                              ['Maximize', 'ShowBlocks','-','About']\n                            ]\n                    });\n\n                    CKFinder.setupCKEditor( {$this->id}_editor, '{$path}/lib/ckfinder/');\n\n                    ";
     }
 }
 /**
  * @covers \NewFrontiers\Framework\Output\Template::img
  */
 public function testImg()
 {
     Template::load('bootadmin', true);
     $baseUrl = Configuration::get('site.internalUrl') . '/templates/bootadmin';
     $imgString = Template::img('image.png', false, null);
     $this->assertEquals($baseUrl . '/img/image.png', $imgString);
     $imgString = Template::img('image.png', true, null);
     $this->assertEquals('<img src="' . $baseUrl . '/img/image.png" />', $imgString);
     $imgString = Template::img('image.png', true, 'meineId');
     $this->assertEquals('<img src="' . $baseUrl . '/img/image.png" id="meineId"/>', $imgString);
 }
 public function toHtml()
 {
     $path = Configuration::get('site.url');
     $iconPath = Template::getInstance()->imgDirectory;
     $script = Configuration::get('site.scriptUrl');
     $this->unterordner = new Kollektion();
     $this->unterordner = $this->unterordner->filter(['parent' => $this->ordner]);
     $this->dateien = new Medien();
     $this->dateien = $this->dateien->filter(['kollektion' => $this->ordner]);
     $div = Html::create('div')->addAttribute('id', $this->id);
     $table = Html::create('table')->css('table')->css('table-striped')->css('table-hover')->addTo($div);
     // HEADER
     $thead = Html::create('thead')->addTo($table);
     $tr = Html::create('tr')->addTo($thead);
     $th = Html::create('th')->addTo($tr)->addInnerHtml('Titel');
     $th = Html::create('th')->addTo($tr)->addInnerHtml('Dateiname');
     $th = Html::create('th')->addTo($tr)->addInnerHtml('Größe');
     $th = Html::create('th')->addTo($tr)->addCssClass('icon')->addInnerHtml('&nbsp;');
     // BODY
     $tbody = Html::create('tbody')->addTo($table);
     // Ebene nach oben
     if ($this->ordnerObj != null && $this->ordnerObj->ko_parent > 0 && $this->showUp) {
         $tr = Html::create('tr')->addTo($tbody);
         $td = Html::create('td')->addTo($tr)->addInnerHtml('<a class="nfs-ajax" data-target="' . $this->ajaxTarget . '" href="' . $script . '/medien/showKollektion/id/' . $this->ordnerObj->ko_parent . '"><img src="' . $iconPath . '/icons/folder_up.png" /> zurück...</a>');
         $td = Html::create('td')->addTo($tr)->addInnerHtml('');
         $td = Html::create('td')->addTo($tr)->addInnerHtml('');
         $td = Html::create('td')->addTo($tr)->addInnerHtml('');
     } elseif ($this->ordnerObj != null && $this->showUp) {
         $tr = Html::create('tr')->addTo($tbody);
         $td = Html::create('td')->addTo($tr)->addInnerHtml('<a class="nfs-ajax" data-target="' . $this->ajaxTarget . '" href="' . $script . '/medien/showKollektion"><img src="' . $iconPath . '/icons/folder_up.png" /> zurück...</a>');
         $td = Html::create('td')->addTo($tr)->addInnerHtml('');
         $td = Html::create('td')->addTo($tr)->addInnerHtml('');
         $td = Html::create('td')->addTo($tr)->addInnerHtml('');
     }
     foreach ($this->unterordner as $akt) {
         $tr = Html::create('tr')->addTo($tbody);
         $td = Html::create('td')->addTo($tr)->addInnerHtml('<a class="nfs-ajax" data-target="' . $this->ajaxTarget . '" href="' . $script . '/medien/showKollektion/id/' . $akt->id . '"><img src="' . $iconPath . '/files/folder.png" /> ' . $akt->ko_bezeichnung . "</a> <a href=\"" . $script . "/medien/editKollektion/id/" . $akt->id . "\">[Edit]</a>");
         $td = Html::create('td')->addTo($tr)->addInnerHtml('');
         $td = Html::create('td')->addTo($tr)->addInnerHtml('');
         $td = Html::create('td')->addTo($tr)->addCssClass('icons')->addInnerHtml('<a class="nfs-ajax" data-target="' . $this->ajaxTarget . '" href="' . $script . '/medien/deleteKollektion/id/' . $akt->id . '"><img src="' . $iconPath . '/icons/delete.png" /></a>');
     }
     foreach ($this->dateien as $akt) {
         $tr = Html::create('tr')->addTo($tbody);
         // TODO: Bilder und andere Dokumente unterscheiden
         $td = Html::create('td')->addTo($tr)->addInnerHtml('<a class="magnigic-popup" href="' . $path . '/medien/' . $akt->me_kollektion . '/' . $akt->me_dateiname . '"><img src="' . $iconPath . '/files/' . $akt->me_erweiterung . '.png" /> ' . $akt->me_titel . "</a>&nbsp;&nbsp;&nbsp; <a href=\"" . $script . "/medien/editMedien/id/" . $akt->id . "\">[Edit]</a>");
         $td = Html::create('td')->addTo($tr)->addInnerHtml($akt->me_dateiname);
         $td = Html::create('td')->addTo($tr)->addInnerHtml(intval($akt->me_groesse / 1024) . ' KB');
         $td = Html::create('td')->addTo($tr)->addCssClass('icons')->addInnerHtml('<a href="' . $script . '/medien/deleteMedien/id/' . $akt->id . '"><img src="' . $iconPath . '/icons/delete.png" /></a> ');
     }
     $script = Html::create('script')->addInnerHtml("\n            \$('.magnific-popup').magnificPopup({\n                type: 'image'\n            });\n          ");
     return $table->render() . $script->render();
 }
 public function toHtml()
 {
     $div = Html::createElement('div')->addCssClass('flowelement')->addAttribute('id', $this->id);
     $span = Html::createElement('span')->addCssClass('box')->addInnerHtml($this->text . ' ')->addTo($div);
     if ($this->aktivitaet->wa_status >= 100) {
         $img = Html::createElement('img')->addTo($span)->addAttribute('src', Template::img('icons/tick.png'))->addAttribute('title', 'Abgeschlossen am ' . $this->aktivitaet->wa_abschlussdatum . ' von ' . $this->aktivitaet->abschlussbenutzer_vorname . ' ' . $this->aktivitaet->abschlussbenutzer_name);
         $span->addCssClass('complete');
     } elseif ($this->aktivitaet->wa_status >= 0) {
         $span->addInnerHtml('<a href="' . Configuration::get('site.scriptUrl') . '/workflow/finishActivity/id/' . $this->aktivitaet->id . '" class="tick">&nbsp;</a>');
         $span->addCssClass('active');
     } else {
         $span->addCssClass('not_yet');
     }
     return $div->render();
 }
 /**
  * Zeigt die Debug-Console an
  */
 public static function showDebugConsole()
 {
     if (Configuration::get('logging.debug') !== 'true') {
         return;
     }
     // TODO: Localhost!
     $allowed = ['92.217.151.126', '213.188.124.2', '94.219.179.56', '::1', '127.0.0.1', '92.217.158.188', '188.97.199.247', '94.219.93.70'];
     if (!in_array($_SERVER['REMOTE_ADDR'], $allowed)) {
         return;
     }
     Profiler::endAll();
     $debugConsole = new DebugConsoleControl(null, 'dbg');
     $html = $debugConsole->toHtml();
     echo $html;
 }
 protected function getStdEditControl($readOnly = false)
 {
     $control = new ControlContainer(null);
     $id = 'image' . $this->name;
     if ($this->getValue() != '' && file_exists('medien/-1/' . $this->getValue())) {
         $url = Configuration::get('site.url') . "/medien/-1/thumbs/{$this->getValue()}";
     } else {
         $url = Configuration::get('site.url') . "/pixel.png";
     }
     $htmlControl = new HtmlControl($control);
     $htmlControl->setInnerHtml("<img src=\"{$url}\" id=\"{$id}\" class=\"img-thumbnail\" />");
     $uploader = new UploaderControl($control, $this->name);
     $uploader->setTargetFilename($this->entity->id);
     $uploader->setValue($this->getValue());
     return $control;
 }
 protected function registerPlugins()
 {
     $basePath = Configuration::get('site.internalUrl') . '/bower_components/froala-wysiwyg-editor';
     Javascript::requireLibrary('froala');
     Javascript::registerLibrary('froala-align', ["{$basePath}/js/plugins/align.min.js"]);
     Javascript::registerLibrary('froala-charCounter', ["{$basePath}/js/plugins/char_counter.min.js"]);
     Javascript::registerLibrary('froala-codeBeautifier', ["{$basePath}/js/plugins/code_beautifier.min.js"]);
     Javascript::registerLibrary('froala-codeView', ["{$basePath}/js/plugins/code_view.min.js"]);
     Javascript::registerLibrary('froala-colors', ["{$basePath}/js/plugins/colors.min.js"]);
     Javascript::registerLibrary('froala-draggable', ["{$basePath}/js/plugins/draggable.min.js"]);
     Javascript::registerLibrary('froala-emoticons', ["{$basePath}/js/plugins/emoticons.min.js"]);
     Javascript::registerLibrary('froala-entities', ["{$basePath}/js/plugins/entities.min.js"]);
     Javascript::registerLibrary('froala-file', ["{$basePath}/js/plugins/file.min.js"]);
     Javascript::registerLibrary('froala-fontFamily', ["{$basePath}/js/plugins/font_family.min.js"]);
     Javascript::registerLibrary('froala-fontSize', ["{$basePath}/js/plugins/font_size.min.js"]);
     Javascript::registerLibrary('froala-fullscreen', ["{$basePath}/js/plugins/fullscreen.min.js"]);
     Javascript::registerLibrary('froala-image', ["{$basePath}/js/plugins/image.min.js"]);
     Javascript::registerLibrary('froala-imageManager', ["{$basePath}/js/plugins/image_manager.min.js"]);
     Javascript::registerLibrary('froala-inlineStyle', ["{$basePath}/js/plugins/inline_style.min.js"]);
     Javascript::registerLibrary('froala-lineBreaker', ["{$basePath}/js/plugins/line_breaker.min.js"]);
     Javascript::registerLibrary('froala-link', ["{$basePath}/js/plugins/link.min.js"]);
     Javascript::registerLibrary('froala-lists', ["{$basePath}/js/plugins/lists.min.js"]);
     Javascript::registerLibrary('froala-paragraphFormat', ["{$basePath}/js/plugins/paragraph_format.min.js"]);
     Javascript::registerLibrary('froala-paragraphStyle', ["{$basePath}/js/plugins/paragraph_style.min.js"]);
     Javascript::registerLibrary('froala-quickInsert', ["{$basePath}/js/plugins/quick_insert.min.js"]);
     Javascript::registerLibrary('froala-quote', ["{$basePath}/js/plugins/quote.min.js"]);
     Javascript::registerLibrary('froala-save', ["{$basePath}/js/plugins/save.min.js"]);
     Javascript::registerLibrary('froala-table', ["{$basePath}/js/plugins/table.min.js"]);
     Javascript::registerLibrary('froala-url', ["{$basePath}/js/plugins/url.min.js"]);
     Javascript::registerLibrary('froala-video', ["{$basePath}/js/plugins/video.min.js"]);
     Css::registerLibrary('froala-charCounter', ["{$basePath}/css/plugins/char_counter.min.css"]);
     Css::registerLibrary('froala-codeView', ["{$basePath}/css/plugins/code_view.min.css"]);
     Css::registerLibrary('froala-colors', ["{$basePath}/css/plugins/colors.min.css"]);
     Css::registerLibrary('froala-draggable', ["{$basePath}/css/plugins/draggable.min.css"]);
     Css::registerLibrary('froala-emoticons', ["{$basePath}/css/plugins/emoticons.min.css"]);
     Css::registerLibrary('froala-file', ["{$basePath}/css/plugins/file.min.css"]);
     Css::registerLibrary('froala-fullscreen', ["{$basePath}/css/plugins/fullscreen.min.css"]);
     Css::registerLibrary('froala-image', ["{$basePath}/css/plugins/image.min.css"]);
     Css::registerLibrary('froala-imageManager', ["{$basePath}/css/plugins/image_manager.min.css"]);
     Css::registerLibrary('froala-lineBreaker', ["{$basePath}/css/plugins/line_breaker.min.css"]);
     Css::registerLibrary('froala-quickInsert', ["{$basePath}/css/plugins/quick_insert.min.css"]);
     Css::registerLibrary('froala-table', ["{$basePath}/css/plugins/table.min.css"]);
     Css::registerLibrary('froala-video', ["{$basePath}/css/plugins/video.min.css"]);
 }
 public function postRoute(&$request)
 {
     // Das normale Routing hat etwas ergeben
     if (isset($request->module, $request->action)) {
         return;
     }
     Profiler::startSection('Routing.postRoute');
     // Default-Page, falls nichts gefunden
     Logging::info('[Post-Route] Default-Page wird angezeigt');
     $defaultId = Configuration::get('site.defaultPageId');
     if ($defaultId <= 0) {
         throw new \Exception('Keine Defaultseite gesetzt!');
     }
     $default = new Page($defaultId);
     $this->setCurrentPage($request, $default);
     Profiler::endSection('Routing.postRoute');
 }
Exemplo n.º 14
0
 /**
  * Diese Methode gibt einen String aus, der alle einzubinden JS Dateien als HTML-Tags enthält
  * @param bool $beginning
  */
 public static function includeRequiredLibraries($beginning = true)
 {
     $manager = self::getInstance();
     $url = Configuration::get('site.internalUrl') . '/js';
     $bowerUrl = $url . '/components';
     $scripts = array();
     foreach ($manager->requiredLibraries as $key => &$lib) {
         if ($lib['included']) {
             continue;
         }
         if (array_key_exists($key, $manager->registeredLibraries)) {
             $manager->includeRegisteredLibrary($key, $scripts);
         } elseif ($lib['library'] === 'nfs.StdControls') {
             $scripts[] = Script::library("{$url}/nostromo/ModalizerControl.js?v3");
             $scripts[] = Script::library("{$bowerUrl}/spin.js/spin.js");
             $scripts[] = Script::library("{$bowerUrl}/spin.js/jquery.spin.js");
             $scripts[] = Script::library("{$bowerUrl}/jquery-validation/dist/jquery.validate.min.js");
             $scripts[] = Script::library("{$bowerUrl}/globalize/lib/globalize.js");
             $scripts[] = Script::library("{$bowerUrl}/globalize/lib/cultures/globalize.culture.de-DE.js");
             $scripts[] = Script::library("{$url}/nostromo/validator.languages.de.js");
             $scripts[] = Script::library("{$url}/nostromo/jquery.validate.globalize.min.js");
         } elseif ($lib['library'] === 'nfs.ExtControls') {
             $scripts[] = Script::library("{$url}/nostromo/SubmitDataControl.js");
         } elseif ($lib['library'] === 'nfs.DataControls') {
             $scripts[] = Script::library("{$url}/nostromo/GridControl.js");
         } elseif ($lib['library'] === 'jQuery') {
             //$scripts[] = HtmlScript::createElement("$path/bower_components/jquery/dist/jquery.min.js");
         } elseif ($lib['library'] === 'datetimepicker') {
             $scripts[] = Script::library("{$bowerUrl}/moment/min/moment.min.js");
             $scripts[] = Script::library("{$bowerUrl}/moment/locale/de.js");
             $scripts[] = Script::library("{$bowerUrl}/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js");
         } elseif ($lib['library'] === 'typeahead') {
             $scripts[] = Script::library("{$bowerUrl}/typeahead.js/dist/typeahead.bundle.min.js");
         } elseif ($lib['library'] === 'googlemaps') {
             $scripts[] = Script::library("//maps.google.com/maps/api/js?sensor=true");
             $scripts[] = Script::library("{$bowerUrl}/gmaps/gmaps.js");
         } elseif ($lib['library'] === 'jqueryuploader') {
             $scripts[] = Script::library("{$url}/fileupload/jquery.ui.widget.js");
             $scripts[] = Script::library("{$url}/fileupload/jquery.iframe-transport.js");
             $scripts[] = Script::library("{$url}/fileupload/jquery.fileupload.js");
         } elseif ($lib['library'] === 'bootstrap-toggle') {
             $scripts[] = Script::library("{$bowerUrl}/bootstrap-toggle/js/bootstrap-toggle.min.js");
         } elseif ($lib['library'] === 'bootstrap-star-rating') {
             $scripts[] = Script::library("{$bowerUrl}/bootstrap-star-rating/js/star-rating.min.js");
         } elseif ($lib['library'] === 'code-prettify') {
             $scripts[] = Script::library("https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js");
         } elseif ($lib['library'] === 'bootstrap-slider') {
             $scripts[] = Script::library("{$bowerUrl}/seiyria-bootstrap-slider/js/bootstrap-slider.js");
         } elseif ($lib['library'] === 'chosen') {
             $scripts[] = Script::library("{$bowerUrl}/chosen/chosen.jquery.js");
         } elseif ($lib['library'] === 'froala') {
             $scripts[] = Script::library("{$bowerUrl}/froala-wysiwyg-editor/js/froala_editor.min.js");
             $scripts[] = Script::library('//cdnjs.cloudflare.com/ajax/libs/codemirror/5.3.0/codemirror.min.js');
             $scripts[] = Script::library('//cdnjs.cloudflare.com/ajax/libs/codemirror/5.3.0/mode/xml/xml.min.js');
         } elseif ($lib['library'] === 'Chart.js') {
             $scripts[] = Script::library("{$bowerUrl}/Chart.js/dist/Chart.min.js");
         }
         $lib['included'] = true;
     }
     $result = '';
     foreach ($scripts as $curScript) {
         $result .= $curScript->render() . "\n";
     }
     echo $result;
 }
Exemplo n.º 15
0
 public function toJavascript()
 {
     Javascript::requireLibrary('jQuery');
     Javascript::requireLibrary('nfs.DataControls');
     if (!isset($this->deleteModule)) {
         $this->deleteModule = $this->entity->getModuleName();
     }
     $gridUrl = Configuration::get('site.internalUrl') . '/ajaxGridControl.php';
     $url = Configuration::get('site.scriptUrl');
     $result = "\n            var {$this->id} = new GridControl(\$('#{$this->id}'), {\n                deleteModule: '{$this->deleteModule}',\n                deleteAction: '{$this->deleteAction}',\n                gridUrl: '{$gridUrl}',\n                url: '{$url}'\n            }).setup();\n            ";
     return $result;
 }
Exemplo n.º 16
0
 public function getAvatarTag()
 {
     return Html::create('img')->attr('src', Configuration::get('site.internalUrl') . '/medien/-1/thumbs/' . $this->val('us_profilbild'));
 }
 public function __construct()
 {
     $this->currentLogLevel = Configuration::get('logging.level', LoggingProvider::LOG_TRACE);
     $this->info('Verwendetes Log-Level: ' . $this->currentLogLevel);
 }
Exemplo n.º 18
0
    <!-- /.modal-dialog -->
</div>


<?php 
Template::js('jquery-2.1.1.js');
Template::js('bootstrap.min.js');
Template::js('plugins/metisMenu/jquery.metisMenu.js');
Template::js('plugins/slimscroll/jquery.slimscroll.min.js');
Template::js('inspinia.js');
Template::js('plugins/pace/pace.min.js');
Template::js('plugins/jvectormap/jquery-jvectormap-2.0.2.min.js');
Template::js('plugins/jvectormap/jquery-jvectormap-world-mill-en.js');
Template::js('ModalizerControl.js', Configuration::get('site.internalUrl') . '/assets');
Template::js('GridControl.js', Configuration::get('site.internalUrl') . '/assets');
Template::js('spin.js', Configuration::get('site.internalUrl') . '/bower_components/spin.js');
Template::js('jquery.spin.js', Configuration::get('site.internalUrl') . '/bower_components/spin.js');
Template::js('jquery.validate.min.js', Configuration::get('site.internalUrl') . '/bower_components/jquery-validation/dist');
Template::js('globalize.js', Configuration::get('site.internalUrl') . '/bower_components/globalize/lib');
Template::js('globalize.culture.de-DE.js', Configuration::get('site.internalUrl') . '/bower_components/globalize/lib/cultures');
Template::js('validator.languages.de.js', Configuration::get('site.internalUrl') . '/assets');
Template::js('jquery.validate.globalize.min.js', Configuration::get('site.internalUrl') . '/assets');
Template::js('Chart.min.js', Configuration::get('site.internalUrl') . '/bower_components/Chart.js/dist');
Debug::showDebugConsole();
Javascript::display();
?>

</body>

</html>
 /**
  * Löscht abgelaufene Dateien
  */
 public function removeExpiredShares()
 {
     $buffer_days = 15;
     $medien = Medien::filter(array('share' => 1));
     $send = false;
     $nachricht = "Folgende abgelaufene Dateien wurden automatisch gelöscht: \n\n";
     foreach ($medien as $medium) {
         $invalid = strtotime($medium->me_valid_until);
         if (strtotime("+" . $buffer_days . "days", $invalid) < time()) {
             $nachricht .= $medium->me_titel . "\n";
             $medium->delete();
             $send = true;
         }
     }
     if ($send) {
         $empfaenger = Configuration::get('mail.shareInfo');
         $betreff = '[' . Configuration::get('site.title') . '] Geteilte Dateien wurden gelöscht';
         return PhpMailer::getInstance()->sendMail($empfaenger, $betreff, $nachricht);
     }
 }
 /**
  * Gibt zurück, ob man sich aktuell auf der Startseite der Anwendung befindet.
  * @return bool
  */
 public static function isFrontpage()
 {
     return static::currentPage() !== null and static::currentPage()->id == Configuration::get('site.defaultPageId');
 }
Exemplo n.º 21
0
 /**
  * Gibt den lokalen Pfad zur Originaldatei für den Mailversand zurück
  * @return string
  */
 public function getLocalPathForMail()
 {
     if ($this->isBild()) {
         return Configuration::get('site.localPath') . DIRECTORY_SEPARATOR . 'medien' . DIRECTORY_SEPARATOR . $this->me_kollektion . DIRECTORY_SEPARATOR . 'resized' . DIRECTORY_SEPARATOR . $this->getFileSystemName();
     } else {
         return Configuration::get('site.localPath') . DIRECTORY_SEPARATOR . 'medien' . DIRECTORY_SEPARATOR . $this->me_kollektion . DIRECTORY_SEPARATOR . $this->getFileSystemName();
     }
 }
 public function toJavascript()
 {
     return "\n\n\n            var kontakte{$this->id} = new Bloodhound({\n              datumTokenizer: Bloodhound.tokenizers.obj.whitespace('ko_bezeichnung'),\n              queryTokenizer: Bloodhound.tokenizers.whitespace,\n              remote: '" . Configuration::get('site.url') . "/esvTypeahead.php?query=%QUERY',\n              limit: 20\n            });\n\n            kontakte{$this->id}.initialize();\n\n\n            \$('#" . $this->id . "').typeahead(\n                {\n                  minLength: 3,\n                  highlight: true,\n                },\n                {\n                  name: 'esv-kontakte',\n                  displayKey: 'ko_bezeichnung',\n                  source: kontakte{$this->id}.ttAdapter(),\n                  templates: {\n                        suggestion: function (data) {\n                            return '<p><span class=\"pull-right nummer\">' + data.ko_nummer + '</span>' + data.ko_bezeichnung + '</p>';\n                        }\n                  }\n                }\n            );\n        ";
 }
Exemplo n.º 23
0
                    </li>
                </ul>
            </div>
            <!-- /.navbar-collapse -->

        </div>
    </nav>
<?php 
} else {
    ?>

    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <img src="<?php 
    echo Configuration::get('site.internalUrl');
    ?>
/templates/login_dtv/img/logo_dtv.png">
            </div>
        </div>
    </div>

<?php 
}
?>

<div class="container">
    <div class="row">


        <div class="col-md-12" role="main">
Exemplo n.º 24
0
<?php

use NewFrontiers\Framework\Core\ConfigurationProvider;
use NewFrontiers\Framework\Database\Database;
use Nostromo\Contracts\Facades\Configuration;
use NewFrontiers\Framework\Core\Application;
use Symfony\Component\EventDispatcher\EventDispatcher;
// Registrieren der benötigten Services
Application::register('configuration', ConfigurationProvider::getInstance());
Application::register('module', new \NewFrontiers\Provider\Module\XmlModuleProvider());
Application::register('logging', new \NewFrontiers\Provider\Logging\MemoryLoggingProvider());
Application::register('routing', new \NewFrontiers\Provider\Routing\SitemapRoutingProvider());
Application::register('security', new \NewFrontiers\Provider\Security\SqlSecurityProvider());
Application::register('cache', new NewFrontiers\Provider\Cache\SessionCacheProvider());
Application::register('dispatcher', new EventDispatcher());
Application::register('default_database', new Database());
// Datenbank-Engine auf MySQL setzen
Database::getInstance()->setEngine(Configuration::get('database.engine', Database::DB_MYSQL));
Exemplo n.º 25
0
 /**
  *
  */
 public function redirectToFrontpage()
 {
     self::redirect(Configuration::get('site.scriptUrl'));
 }
 public function toJavascript()
 {
     $url = Routing::appLink($this->module, $this->action);
     $siteurl = Configuration::get('site.url');
     if ($this->showThumbnail) {
         $dir = 'thumbs';
     } else {
         $dir = 'resized';
     }
     $formFieldText = '';
     foreach ($this->formFields as $field) {
         $formFieldText .= ", {$field['name']}: {$field['function']}";
     }
     return "\n            // Define the url to send the image data to\n            var url = '{$url}';\n\n            // Call the fileupload widget and set some parameters\n            \$('#fileupload{$this->id}').fileupload({\n                url: url,\n                dataType: 'json',\n\n                submit: function(e, data) {\n                        data.formData = {\n                            kollektion: {$this->kollektionId},\n                            info: {$this->info},\n                            target: '{$this->targetFilename}',\n                            token: '{$this->token}' {$formFieldText}\n                        };\n\n                        \$('#progress-outer{$this->id}').css('display', 'block');\n                        \$('#progress{$this->id}').addClass('active');\n                        \$('#files{$this->id}').empty();\n\n\n                },\n\n                progressall: function (e, data) {\n                    // Update the progress bar while files are being uploaded\n                    var progress = parseInt(data.loaded / data.total * 100, 10);\n                    \$('#progress{$this->id} .bar').css(\n                        'width',\n                        progress + '%'\n                    );\n                },\n\n                done: function (e, data) {\n                    \$.each(data.result.files, function (index, file) {\n                        if (file.error){\n                            var html = '<b>'+file.name+'</b>: '+ file.error;\n                            \$('<div/>').addClass('alert alert-danger').html(html).appendTo('#files');\n                        } else {\n                            var html = '<b>'+file.name+'</b>';\n                            \$('<div/>').addClass('alert alert-success').html(html).appendTo('#files');\n                            \$('#{$this->id}').val(file.name);\n\n                            if (\$('#image{$this->id}') != null) {\n                                \$('#image{$this->id}').attr('src', file.url);\n                            }\n\n                        }\n                    });\n                    \$('#progress{$this->id}').removeClass('active');\n                    \$('#progress-outer{$this->id}').css('display', 'none');\n                    \$('#files-outer{$this->id}').css('display', 'block');\n\n                    if ('{$this->notify}' != '')\n                        \$('#{$this->notify}').data('control').update();\n\n\n                }\n            });\n        ";
 }
Exemplo n.º 27
0
 /**
  * Verbindung zur Datenbank aufbauen
  *
  * @throws \RuntimeException
  */
 public function connect()
 {
     if ($this->provider === null) {
         throw new \RuntimeException('Setzen Sie erst die Datenbank-Engine, bevor Sie eine Verbindung aufbauen');
     }
     if ($this->connected) {
         return;
     }
     Profiler::startSection('Database.connect');
     $this->connected = true;
     $host = Configuration::get('database.host');
     $user = Configuration::get('database.user');
     $pass = Configuration::get('database.password');
     $dbname = Configuration::get('database.dbname');
     $this->pdo = $this->provider->getConnection($host, $dbname, $user, $pass);
     Profiler::endSection('Database.connect');
 }
Exemplo n.º 28
0
 /**
  * Shortcut Methode, die die übergebene Nachricht an den in der Konfiguration
  * hinterlegten Eigentümer sendet.
  *
  * @param string $betreff
  * @param string $nachricht
  */
 public static function sendNotification($betreff, $nachricht)
 {
     Mailer::getInstance()->sendMail(Configuration::get('mail.from'), $betreff, $nachricht);
 }
Exemplo n.º 29
0
 /**
  * @inheritdoc
  */
 public function toHtml()
 {
     if ($this->action !== '') {
         $this->addHiddenValue('action', $this->action);
         $this->addHiddenValue('module', $this->module);
         $url = Configuration::get('site.scriptUrl');
         if (strpos($url, '.php') === false) {
             $url = Configuration::get('site.internalUrl') . '/index.php';
         }
     } else {
         $url = $this->url;
     }
     $form = Html::create('form');
     $form->attr('id', $this->id)->attr('enctype', $this->encoding)->attr('action', $url)->attr('method', $this->method)->attr('role', 'form')->text($this->renderChildren());
     return $form->render();
 }
Exemplo n.º 30
0
 /**
  * @param string|array $match
  * @param BaseEntity $entity
  * @param Control $controlContainer
  * @param $vars
  * @param $useControl
  * @return mixed
  */
 private function getReplacement($match, $entity, $controlContainer, $vars, $useControl)
 {
     if ($match === 'controls') {
         // Unter-Controls ausgeben
         return $controlContainer->renderChildren();
     } elseif (is_array($match)) {
         if (array_key_exists($match[0], $vars)) {
             // Zusammengesetzter Wert
             $variable = $match[0];
             $property = $match[1];
             return $vars[$variable]->{$property};
         } elseif (Configuration::get($match[0] . '.' . $match[1]) !== null) {
             // Konfigurations-Wert
             return Configuration::get($match[0] . '.' . $match[1]);
         }
     } elseif (array_key_exists($match, $vars)) {
         // Ein Wert im Variablen-Array
         return $this->getWertFromVars($match, $vars);
     } elseif ($entity !== null && $match === $entity->primaryKey) {
         // Primärschlüssel des Entity
         return $entity->id;
     } elseif ($controlContainer !== null && $controlContainer->get($match) !== null) {
         // Control ausgeben [nur HTML]
         return $controlContainer->get($match)->toHtml();
     } elseif ($entity !== null && $entity->hasField($match)) {
         // String-Repräsentation eines Felds [oder das Control]
         return $this->getWertFromEntity($match, $entity, $useControl);
     } elseif ($entity !== null && $entity->getParserText($match) !== '') {
         // Text aus dem Entity
         return $entity->getParserText($match);
     }
     return '';
 }