/** * Test for AuthenticationSignon::auth * * @return void */ public function testAuth() { if (!defined('PMA_TEST_HEADERS')) { $this->markTestSkipped('Cannot redefine constant/function - missing runkit extension'); } // case 1 $GLOBALS['cfg']['Server']['SignonURL'] = ''; ob_start(); $this->object->auth(); $result = ob_get_clean(); $this->assertContains('You must set SignonURL!', $result); // case 2 $GLOBALS['cfg']['Server']['SignonURL'] = 'http://phpmyadmin.net/SignonURL'; $_REQUEST['old_usr'] = '******'; $GLOBALS['cfg']['Server']['LogoutURL'] = 'http://phpmyadmin.net/logoutURL'; $this->object->auth(); $this->assertContains('Location: http://phpmyadmin.net/logoutURL?PHPSESSID=', $GLOBALS['header'][0]); // case 3 $GLOBALS['header'] = array(); $GLOBALS['cfg']['Server']['SignonURL'] = 'http://phpmyadmin.net/SignonURL'; $_REQUEST['old_usr'] = ''; $GLOBALS['cfg']['Server']['LogoutURL'] = ''; $this->object->auth(); $this->assertContains('Location: http://phpmyadmin.net/SignonURL?PHPSESSID=', $GLOBALS['header'][0]); }
function dump($var, $echo = true, $label = null, $strict = true) { $label = $label === null ? '' : rtrim($label) . ' '; if (!$strict) { if (ini_get('html_errors')) { $output = print_r($var, true); $output = "<pre>" . $label . htmlspecialchars($output, ENT_QUOTES) . "</pre>"; } else { $output = $label . " : " . print_r($var, true); } } else { ob_start(); var_dump($var); $output = ob_get_clean(); if (!extension_loaded('xdebug')) { $output = preg_replace("/\\]\\=\\>\n(\\s+)/m", "] => ", $output); $output = '<pre>' . $label . htmlspecialchars($output, ENT_QUOTES, "GB2312") . '</pre>'; } } if ($echo) { echo $output; return null; } else { return $output; } }
/** * Parses YAML into a PHP array. * * The parse method, when supplied with a YAML stream (string or file), * will do its best to convert YAML in a file into a PHP array. * * Usage: * <code> * $array = Yaml::parse('config.yml'); * print_r($array); * </code> * * @param string $input Path to a YAML file or a string containing YAML * * @return array The YAML converted to a PHP array * * @throws \InvalidArgumentException If the YAML is not valid * * @api */ public static function parse($input) { // if input is a file, process it $file = ''; if (strpos($input, "\n") === false && is_file($input)) { if (false === is_readable($input)) { throw new ParseException(sprintf('Unable to parse "%s" as the file is not readable.', $input)); } $file = $input; if (self::$enablePhpParsing) { ob_start(); $retval = (include $file); $content = ob_get_clean(); // if an array is returned by the config file assume it's in plain php form else in YAML $input = is_array($retval) ? $retval : $content; // if an array is returned by the config file assume it's in plain php form else in YAML if (is_array($input)) { return $input; } } else { $input = file_get_contents($file); } } $yaml = new Parser(); try { return $yaml->parse($input); } catch (ParseException $e) { if ($file) { $e->setParsedFile($file); } throw $e; } }
public function render() { extract($this->pageVars); ob_start(); require $this->template; echo ob_get_clean(); }
function cf_shortcode() { ob_start(); submitted(); html_form_code(); return ob_get_clean(); }
protected function doDisplay(array $context, array $blocks = array()) { $__internal_7088dc18de042b162a99a327c85232e1f7c79938f5c6e62a2f20a47464d52c5f = $this->env->getExtension("native_profiler"); $__internal_7088dc18de042b162a99a327c85232e1f7c79938f5c6e62a2f20a47464d52c5f->enter($__internal_7088dc18de042b162a99a327c85232e1f7c79938f5c6e62a2f20a47464d52c5f_prof = new Twig_Profiler_Profile($this->getTemplateName(), "template", "WebProfilerBundle:Profiler:toolbar_item.html.twig")); // line 1 if (isset($context["link"]) ? $context["link"] : $this->getContext($context, "link")) { // line 2 echo " "; ob_start(); // line 3 echo " <a href=\""; echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("_profiler", array("token" => isset($context["token"]) ? $context["token"] : $this->getContext($context, "token"), "panel" => isset($context["name"]) ? $context["name"] : $this->getContext($context, "name"))), "html", null, true); echo "\">"; echo twig_escape_filter($this->env, isset($context["icon"]) ? $context["icon"] : $this->getContext($context, "icon"), "html", null, true); echo "</a>\n "; $context["icon"] = '' === ($tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); } // line 6 echo "<div class=\"sf-toolbar-block\">\n <div class=\"sf-toolbar-icon\">"; // line 7 echo twig_escape_filter($this->env, array_key_exists("icon", $context) ? _twig_default_filter(isset($context["icon"]) ? $context["icon"] : $this->getContext($context, "icon"), "") : "", "html", null, true); echo "</div>\n <div class=\"sf-toolbar-info\">"; // line 8 echo twig_escape_filter($this->env, array_key_exists("text", $context) ? _twig_default_filter(isset($context["text"]) ? $context["text"] : $this->getContext($context, "text"), "") : "", "html", null, true); echo "</div>\n</div>\n"; $__internal_7088dc18de042b162a99a327c85232e1f7c79938f5c6e62a2f20a47464d52c5f->leave($__internal_7088dc18de042b162a99a327c85232e1f7c79938f5c6e62a2f20a47464d52c5f_prof); }
public function block_toolbar($context, array $blocks = array()) { // line 4 echo " "; if ($this->getAttribute($this->getContext($context, "collector"), "messagecount")) { // line 5 echo " "; ob_start(); // line 6 echo " <img width=\"23\" height=\"28\" alt=\"Swiftmailer\" src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAAcCAYAAACK7SRjAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6N0NEOTU1MjM0OThFMTFFMDg3NzJBNTE2ODgwQzMxMzQiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6N0NEOTU1MjQ0OThFMTFFMDg3NzJBNTE2ODgwQzMxMzQiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDoxMEQ5OTQ5QzQ5OEMxMUUwODc3MkE1MTY4ODBDMzEzNCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3Q0Q5NTUyMjQ5OEUxMUUwODc3MkE1MTY4ODBDMzEzNCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PpkRnSAAAAJ0SURBVHjaYvz//z8DrQATAw3BqOFYAaO9vT1FBhw4cGCAXA5MipxBQUHT3r17l0AVAxkZ/wkLC89as2ZNIcjlYkALXKnlWqBZTH/+/PEDmQsynLW/v3+NoaHhN2oYDjJn8uTJK4BMNpDhPwsLCwOKiop2+fn5vafEYC8vrw8gc/Lz8wOB3B8gw/nev38vn5WV5eTg4LA/Ly/vESsrK2npmYmJITU19SnQ8L0gc4DxpwgyF2S4EEjB58+f+crLy31YWFjOt7S0XBYUFPxHjMEcHBz/6+rqboqJiZ0qKSnxBpkDlRICGc4MU/j792+2CRMm+L18+fLSxIkTDykoKPzBZ7CoqOi/np6eE8rKylvb29v9fvz4wYEkzYKRzjk5OX/LyMjcnDRpEkjjdisrK6wRraOj8wvokAMLFy788ejRoxcaGhrPCWai4ODgB8DUE3/mzBknYMToASNoMzAfvEVW4+Tk9LmhoWFbTU2NwunTpx2BjiiMjo6+hm4WCzJHUlLyz+vXrxkfP36sDOI/ffpUPikpibe7u3sLsJjQW7VqlSrQxe+Avjmanp7u9PbtWzGQOmCCkARmmu/m5uYfT548yY/V5UpKSl+2b9+uiiz26dMnIWBSDTp27NgdYGrYCIzwE7m5uR4wg2Hg/PnzSsDI/QlKOcjZ3wGUBLm5uf+DwLdv38gub4AG/xcSEvr35s0bZmCB5sgCE/z69SsjyDJKMtG/f/8YQQYD8wkoGf8H51AbG5sH1CpbQBnQ09PzBiiHgoIFFHlBQGwLxLxUMP8dqJgH4k3gIhfIkAKVYkDMTmmhCHIxEL8A4peMo02L4WU4QIABANxZAoDIQDv3AAAAAElFTkSuQmCC\" />\n <span class=\"sf-toolbar-status\">"; // line 7 echo twig_escape_filter($this->env, $this->getAttribute($this->getContext($context, "collector"), "messageCount"), "html", null, true); echo "</span>\n "; $context["icon"] = '' === ($tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); // line 9 echo " "; ob_start(); // line 10 echo " <div class=\"sf-toolbar-info-piece\">\n <b>Messages</b>\n <span>"; // line 12 echo twig_escape_filter($this->env, $this->getAttribute($this->getContext($context, "collector"), "messageCount"), "html", null, true); echo "</span>\n </div>\n <div class=\"sf-toolbar-info-piece\">\n <b>Is spooled ?</b>\n <span>"; // line 16 echo $this->getAttribute($this->getContext($context, "collector"), "isSpool") ? "yes" : "no"; echo "</span>\n </div>\n "; $context["text"] = '' === ($tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); // line 19 echo " "; $this->env->loadTemplate("WebProfilerBundle:Profiler:toolbar_item.html.twig")->display(array_merge($context, array("link" => $this->getContext($context, "profiler_url")))); // line 20 echo " "; } }
/** * 首页 */ public function index() { $file = FCPATH . 'cache/index/home-' . ($this->template->mobile ? 'mb-' : '') . SITE_ID . '.html'; // 系统开启静态首页、静态文件不存在时,才生成文件 //zjp添加,动态显示日期天气温度 if ($_SESSION["de_json"] == '') { $city = "宜春"; $content = file_get_contents("http://api.map.baidu.com/telematics/v3/weather?location=宜春&output=json&ak=i8GFDZTM22uqICZbtioaVbnk"); $de_json = json_decode($content, TRUE); $_SESSION["de_json"] = $de_json; } /*zjp 0819 添加调取最新的调查问卷start*/ //echo APP_DIR; //echo 1; //$this->load->model('category_model'); //$question_id = $this->category_model->get_question_id(); /*zjp 0819 添加调取最新的调查问卷end */ if (SITE_HOME_INDEX && !is_file($file)) { ob_start(); $this->template->assign(array('indexc' => 1, 'meta_title' => SITE_TITLE, 'meta_keywords' => SITE_KEYWORDS, 'meta_description' => SITE_DESCRIPTION, 'de_json' => $_SESSION["de_json"])); $this->template->display('index.html'); $html = ob_get_clean(); @file_put_contents($file, $html, LOCK_EX); echo $html; exit; } else { $this->template->assign(array('indexc' => 1, 'meta_title' => SITE_TITLE, 'meta_keywords' => SITE_KEYWORDS, 'meta_description' => SITE_DESCRIPTION, 'de_json' => $de_json)); $this->template->display('index.html'); } }
function content_565ead2acc18a3_66288090($_smarty_tpl) { echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['addJsDef'][0][0]->addJsDef(array('wishlistProductsIds' => $_smarty_tpl->tpl_vars['wishlist_products']->value), $_smarty_tpl); $_smarty_tpl->smarty->_tag_stack[] = array('addJsDefL', array('name' => 'loggin_required')); $_block_repeat = true; echo $_smarty_tpl->smarty->registered_plugins['block']['addJsDefL'][0][0]->addJsDefL(array('name' => 'loggin_required'), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); echo smartyTranslate(array('s' => 'You must be logged in to manage your wishlist.', 'mod' => 'blockwishlist', 'js' => 1), $_smarty_tpl); $_block_content = ob_get_clean(); $_block_repeat = false; echo $_smarty_tpl->smarty->registered_plugins['block']['addJsDefL'][0][0]->addJsDefL(array('name' => 'loggin_required'), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); $_smarty_tpl->smarty->_tag_stack[] = array('addJsDefL', array('name' => 'added_to_wishlist')); $_block_repeat = true; echo $_smarty_tpl->smarty->registered_plugins['block']['addJsDefL'][0][0]->addJsDefL(array('name' => 'added_to_wishlist'), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); echo smartyTranslate(array('s' => 'The product was successfully added to your wishlist.', 'mod' => 'blockwishlist', 'js' => 1), $_smarty_tpl); $_block_content = ob_get_clean(); $_block_repeat = false; echo $_smarty_tpl->smarty->registered_plugins['block']['addJsDefL'][0][0]->addJsDefL(array('name' => 'added_to_wishlist'), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['addJsDef'][0][0]->addJsDef(array('mywishlist_url' => preg_replace("%(?<!\\\\)'%", "\\'", $_smarty_tpl->tpl_vars['link']->value->getModuleLink('blockwishlist', 'mywishlist', array(), true))), $_smarty_tpl); ?> <?php }
/** * @outputBuffering enabled * @dataProvider argumentsProvider * @depends testUseLatestPHP */ public function testPathCommand($arg, $pattern) { ob_start(); $this->runCommandWithStdout("phpbrew path {$arg}"); $path = ob_get_clean(); $this->assertRegExp($pattern, $path); }
public function captureAppend($partial, $name) { if (!isset($this->_capture_data[$name])) { $this->_capture_data[$name] = ''; } $this->_capture_data[$name] .= ob_get_clean(); }
/** * modified wpsc end category query function */ function return_wpsc_end_category_query() { global $wpdb, $wpsc_category_query; $category_html = ob_get_clean(); return wpsc_display_category_loop($wpsc_category_query, $category_html); unset($GLOBALS['wpsc_category_query']); }
function easymedia_frontend_prop() { $boxstyle = EASYMEDG_PLUGIN_URL . 'css/styles/mediabox'; echo "<link rel=\"stylesheet\" type=\"text/css\" media=\"screen,projection\" href=\"{$boxstyle}/Light.css\" />\n"; ob_start(); ?> <!-- Easy Media Gallery Lite START (version <?php echo EASYMEDIA_VERSION; ?> )--> <script type="text/javascript"> /*<![CDATA[*/ /* Easy Media Gallery */ jQuery(document).ready(function($) { var add = "easymedia"; jQuery('.da-thumbs a[rel!="easymedia"]').attr('rel', function (i, old) { return old ? old + ' ' + add : add; }); }); /*]]>*/</script> <!--[if lt IE 9]> <script src="<?php echo plugins_url('js/func/html5.js', __FILE__); ?> " type="text/javascript"></script> <![endif]--> <!-- Easy Media Gallery Lite END --> <?php echo ob_get_clean(); }
protected function doDisplay(array $context, array $blocks = array()) { $__internal_023609d92d381e03bd445478c92dce8749d9d9476b3dad6d0720ffef1d0d4875 = $this->env->getExtension("native_profiler"); $__internal_023609d92d381e03bd445478c92dce8749d9d9476b3dad6d0720ffef1d0d4875->enter($__internal_023609d92d381e03bd445478c92dce8749d9d9476b3dad6d0720ffef1d0d4875_prof = new Twig_Profiler_Profile($this->getTemplateName(), "template", "@WebProfiler/Profiler/toolbar_item.html.twig")); // line 1 if (isset($context["link"]) ? $context["link"] : $this->getContext($context, "link")) { // line 2 echo " "; ob_start(); // line 3 echo " <a href=\""; echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("_profiler", array("token" => isset($context["token"]) ? $context["token"] : $this->getContext($context, "token"), "panel" => isset($context["name"]) ? $context["name"] : $this->getContext($context, "name"))), "html", null, true); echo "\">"; echo twig_escape_filter($this->env, isset($context["icon"]) ? $context["icon"] : $this->getContext($context, "icon"), "html", null, true); echo "</a>\n "; $context["icon"] = '' === ($tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); } // line 6 echo "<div class=\"sf-toolbar-block\">\n <div class=\"sf-toolbar-icon\">"; // line 7 echo twig_escape_filter($this->env, array_key_exists("icon", $context) ? _twig_default_filter(isset($context["icon"]) ? $context["icon"] : $this->getContext($context, "icon"), "") : "", "html", null, true); echo "</div>\n <div class=\"sf-toolbar-info\">"; // line 8 echo twig_escape_filter($this->env, array_key_exists("text", $context) ? _twig_default_filter(isset($context["text"]) ? $context["text"] : $this->getContext($context, "text"), "") : "", "html", null, true); echo "</div>\n</div>\n"; $__internal_023609d92d381e03bd445478c92dce8749d9d9476b3dad6d0720ffef1d0d4875->leave($__internal_023609d92d381e03bd445478c92dce8749d9d9476b3dad6d0720ffef1d0d4875_prof); }
/** * Render a template * * Example: * * $template->render('template_name', ['bla' => 'value']); * * @access public * @param string $__template_name Template name * @param array $__template_args Key/Value map of template variables * @return string */ public function render($__template_name, array $__template_args = array()) { extract($__template_args); ob_start(); include $this->getTemplateFile($__template_name); return ob_get_clean(); }
function debugPrint($var, $file = '') { $more_info = ''; if (is_string($var)) { $more_info = 'size: ' . strlen($var); } elseif (is_bool($var)) { $more_info = 'val: ' . ($var ? 'true' : 'false'); } elseif (is_null($var)) { $more_info = 'is null'; } elseif (is_array($var)) { $more_info = count($var); } if ($file === true) { $file = '/tmp/logDebug'; } if (strlen($file) > 0) { $f = fopen($file, "a"); ob_start(); echo date("Y/m/d H:i:s") . " (" . gettype($var) . ") " . $more_info . "\n"; print_r($var); echo "\n\n"; $output = ob_get_clean(); fprintf($f, "%s", $output); fclose($f); } else { echo "<pre>" . date("Y/m/d H:i:s") . " (" . gettype($var) . ") " . $more_info . "</pre>"; echo "<pre>"; print_r($var); echo "</pre>"; } }
public function execute() { $params = $this->extractRequestParams(); $modules = array(); foreach ($params['modules'] as $path) { $modules[] = $this->getModuleFromPath($path); } // Get the help $context = new DerivativeContext($this->getMain()->getContext()); $context->setSkin(SkinFactory::getDefaultInstance()->makeSkin('apioutput')); $context->setLanguage($this->getMain()->getLanguage()); $context->setTitle(SpecialPage::getTitleFor('ApiHelp')); $out = new OutputPage($context); $out->setCopyrightUrl('https://www.mediawiki.org/wiki/Special:MyLanguage/Copyright'); $context->setOutput($out); self::getHelp($context, $modules, $params); // Grab the output from the skin ob_start(); $context->getOutput()->output(); $html = ob_get_clean(); $result = $this->getResult(); if ($params['wrap']) { $data = array('mime' => 'text/html', 'help' => $html); ApiResult::setSubelementsList($data, 'help'); $result->addValue(null, $this->getModuleName(), $data); } else { $result->reset(); $result->addValue(null, 'text', $html, ApiResult::NO_SIZE_CHECK); $result->addValue(null, 'mime', 'text/html', ApiResult::NO_SIZE_CHECK); } }
function calltoaction_sc($atts, $content = '') { extract(shortcode_atts(array("link" => '', "class" => '', "title" => 'Call to actions'), $atts)); $href = ''; if ($link) { $href = 'href="' . $link . '"'; } $classes = "btn"; if ($class) { $classes .= ' ' . $class; } $classes = 'class="' . $classes . '"'; ob_start(); ?> <div class="row"> <div class="twelve col text-center"> <?php echo do_shortcode($content); ?> <a <?php echo $href . ' ' . $classes; ?> ><?php echo $title; ?> </a> </div> </div> <?php $data = ob_get_clean(); return $data; }
protected function doDisplay(array $context, array $blocks = array()) { $__internal_47e46a679ebe1f6c3fe3890c127d510e112b274d7f29ddc36299a2ef0416fbee = $this->env->getExtension("native_profiler"); $__internal_47e46a679ebe1f6c3fe3890c127d510e112b274d7f29ddc36299a2ef0416fbee->enter($__internal_47e46a679ebe1f6c3fe3890c127d510e112b274d7f29ddc36299a2ef0416fbee_prof = new Twig_Profiler_Profile($this->getTemplateName(), "template", "@WebProfiler/Profiler/toolbar_item.html.twig")); // line 1 if (isset($context["link"]) ? $context["link"] : $this->getContext($context, "link")) { // line 2 echo " "; ob_start(); // line 3 echo " <a href=\""; echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("_profiler", array("token" => isset($context["token"]) ? $context["token"] : $this->getContext($context, "token"), "panel" => isset($context["name"]) ? $context["name"] : $this->getContext($context, "name"))), "html", null, true); echo "\">"; echo twig_escape_filter($this->env, isset($context["icon"]) ? $context["icon"] : $this->getContext($context, "icon"), "html", null, true); echo "</a>\n "; $context["icon"] = '' === ($tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); } // line 6 echo "<div class=\"sf-toolbar-block\">\n <div class=\"sf-toolbar-icon\">"; // line 7 echo twig_escape_filter($this->env, array_key_exists("icon", $context) ? _twig_default_filter(isset($context["icon"]) ? $context["icon"] : $this->getContext($context, "icon"), "") : "", "html", null, true); echo "</div>\n <div class=\"sf-toolbar-info\">"; // line 8 echo twig_escape_filter($this->env, array_key_exists("text", $context) ? _twig_default_filter(isset($context["text"]) ? $context["text"] : $this->getContext($context, "text"), "") : "", "html", null, true); echo "</div>\n</div>\n"; $__internal_47e46a679ebe1f6c3fe3890c127d510e112b274d7f29ddc36299a2ef0416fbee->leave($__internal_47e46a679ebe1f6c3fe3890c127d510e112b274d7f29ddc36299a2ef0416fbee_prof); }
protected function _build_belongs($number = 0) { // Initial tabs $tabs = str_repeat(TT, $number); $prefix = 'o'; // Export array $belongs = array(); foreach ($this->_foreigns as $db_column => $foreign) { $alias = $this->_camelize($foreign['table']); $belongs[$prefix . $alias] = array('model' => $alias, 'foreign_key' => $db_column); } ob_start(); var_export($belongs); $html = ob_get_clean(); // Add return $html = 'protected $_belongs_to = ' . $html; // 'array (' to 'array(' $html = preg_replace('/array \\(/', 'array(', $html); // Remove EOL from subarray start $html = preg_replace('/=> \\n /', '=> ', $html); // Replace ' ' with \t $html = preg_replace('/ /', TT, $html); // Add initial tabs $html = preg_replace('/^(.*)$/m', $tabs . '$1', $html); return $html . ';'; //echo '<pre>'.$html; //die(); }
public static function generateIMG($code, $text, $height = 100, $class = "") { ob_start(); self::generate($code, $text, $height); $buffer = ob_get_clean(); return '<img class="' . $class . '" src="data:image/png;base64,' . base64_encode($buffer) . '">'; }
static function render($list, $args = array()) { if (empty($list->items)) { return ''; } $args = wp_parse_args($args, array('before_list' => '<ul>', 'after_list' => '</ul>', 'before_item' => '<li>', 'after_item' => '</li>', 'separator' => false, 'echo' => true)); if ($args['separator']) { if ('<ul>' == $args['before_list']) { $args['before_list'] = ''; } if ('</ul>' == $args['after_list']) { $args['after_list'] = ''; } } if (!$args['echo']) { ob_start(); } echo $args['before_list']; if ($args['separator']) { $rendered = array(); foreach ($list->items as $item) { $rendered[] = self::render_item($item); } echo implode($args['separator'], $rendered); } else { foreach ($list->items as $item) { echo $args['before_item'] . self::render_item($item) . $args['after_item']; } } echo $args['after_list']; if (!$args['echo']) { return ob_get_clean(); } }
protected function doDisplay(array $context, array $blocks = array()) { $__internal_f6fbb0d538f0cf945a7cc2537fcd6ea50556067234df0d59685d58ab6cd80c70 = $this->env->getExtension("native_profiler"); $__internal_f6fbb0d538f0cf945a7cc2537fcd6ea50556067234df0d59685d58ab6cd80c70->enter($__internal_f6fbb0d538f0cf945a7cc2537fcd6ea50556067234df0d59685d58ab6cd80c70_prof = new Twig_Profiler_Profile($this->getTemplateName(), "template", "@WebProfiler/Profiler/toolbar_item.html.twig")); // line 1 if (isset($context["link"]) ? $context["link"] : $this->getContext($context, "link")) { // line 2 echo " "; ob_start(); // line 3 echo " <a href=\""; echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("_profiler", array("token" => isset($context["token"]) ? $context["token"] : $this->getContext($context, "token"), "panel" => isset($context["name"]) ? $context["name"] : $this->getContext($context, "name"))), "html", null, true); echo "\">"; echo twig_escape_filter($this->env, isset($context["icon"]) ? $context["icon"] : $this->getContext($context, "icon"), "html", null, true); echo "</a>\n "; $context["icon"] = '' === ($tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); } // line 6 echo "<div class=\"sf-toolbar-block\">\n <div class=\"sf-toolbar-icon\">"; // line 7 echo twig_escape_filter($this->env, array_key_exists("icon", $context) ? _twig_default_filter(isset($context["icon"]) ? $context["icon"] : $this->getContext($context, "icon"), "") : "", "html", null, true); echo "</div>\n <div class=\"sf-toolbar-info\">"; // line 8 echo twig_escape_filter($this->env, array_key_exists("text", $context) ? _twig_default_filter(isset($context["text"]) ? $context["text"] : $this->getContext($context, "text"), "") : "", "html", null, true); echo "</div>\n</div>\n"; $__internal_f6fbb0d538f0cf945a7cc2537fcd6ea50556067234df0d59685d58ab6cd80c70->leave($__internal_f6fbb0d538f0cf945a7cc2537fcd6ea50556067234df0d59685d58ab6cd80c70_prof); }
/** * Run this widget. */ public function run() { $id = $this->id; $content = array(); $items = $this->normalizeTabs($this->tabs, $content); ob_start(); $this->controller->widget('bootstrap.widgets.BootMenu', array('type' => $this->type, 'encodeLabel' => $this->encodeLabel, 'items' => $items)); $tabs = ob_get_clean(); ob_start(); echo '<div class="tab-content">'; echo implode('', $content); echo '</div>'; $content = ob_get_clean(); echo CHtml::openTag('div', $this->htmlOptions); echo $this->placement === self::PLACEMENT_BELOW ? $content . $tabs : $tabs . $content; echo '</div>'; /** @var CClientScript $cs */ $cs = Yii::app()->getClientScript(); $cs->registerScript(__CLASS__ . '#' . $id, "jQuery('#{$id}').tab('show');"); // Register the "show" event-handler. if (isset($this->events['show'])) { $fn = CJavaScript::encode($this->events['show']); $cs->registerScript(__CLASS__ . '#' . $id . '.show', "jQuery('#{$id} a[data-toggle=\"tab\"]').on('show', {$fn});"); } // Register the "shown" event-handler. if (isset($this->events['shown'])) { $fn = CJavaScript::encode($this->events['shown']); $cs->registerScript(__CLASS__ . '#' . $id . '.shown', "jQuery('#{$id} a[data-toggle=\"tab\"]').on('shown', {$fn});"); } }
function tag() { $doc = JFactory::getDocument(); $doc->addStyleSheet(ACYMAILING_CSS . 'frontendedition.css?v=' . filemtime(ACYMAILING_MEDIA . 'css' . DS . 'frontendedition.css')); JPluginHelper::importPlugin('acymailing'); $dispatcher = JDispatcher::getInstance(); $tagsfamilies = $dispatcher->trigger('acymailing_getPluginType'); $defaultFamily = reset($tagsfamilies); $app = JFactory::getApplication(); $fctplug = $app->getUserStateFromRequest(ACYMAILING_COMPONENT . ".tag", 'fctplug', $defaultFamily->function, 'cmd'); ob_start(); $defaultContents = $dispatcher->trigger($fctplug); $defaultContent = ob_get_clean(); $js = 'function insertTag(){if(window.parent.insertTag(window.document.getElementById(\'tagstring\').value)) {acymailing_js.closeBox(true);}}'; $js .= 'function setTag(tagvalue){window.document.getElementById(\'tagstring\').value = tagvalue;}'; $js .= 'function showTagButton(){window.document.getElementById(\'insertButton\').style.display = \'inline\'; window.document.getElementById(\'tagstring\').style.display=\'inline\';}'; $js .= 'function hideTagButton(){}'; $js .= 'try{window.parent.previousSelection = window.parent.getPreviousSelection(); }catch(err){window.parent.previousSelection=false; }'; $doc->addScriptDeclaration($js); $this->assignRef('fctplug', $fctplug); $type = JRequest::getString('type', 'news'); $this->assignRef('type', $type); $this->assignRef('defaultContent', $defaultContent); $this->assignRef('tagsfamilies', $tagsfamilies); $app = JFactory::getApplication(); $this->assignRef('app', $app); $ctrl = JRequest::getString('ctrl'); $this->assignRef('ctrl', $ctrl); }
function jigoshop_product_tag($attributes) { global $paged; $jigoshop_options = Jigoshop_Base::get_options(); $attributes = shortcode_atts(array('tag' => '', 'per_page' => $jigoshop_options->get('jigoshop_catalog_per_page'), 'columns' => $jigoshop_options->get('jigoshop_catalog_columns'), 'orderby' => $jigoshop_options->get('jigoshop_catalog_sort_orderby'), 'order' => $jigoshop_options->get('jigoshop_catalog_sort_direction'), 'pagination' => false, 'tax_operator' => 'IN'), $attributes); if (isset($_REQUEST['tag'])) { $attributes['tag'] = $_REQUEST['tag']; } /** Operator validation. */ if (!in_array($attributes['tax_operator'], array('IN', 'NOT IN', 'AND'))) { $tax_operator = 'IN'; } /** Multiple category values. */ if (!empty($slug)) { $slug = explode(',', esc_attr($slug)); $slug = array_map('trim', $slug); } $args = array('post_type' => 'product', 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'posts_per_page' => $attributes['per_page'], 'orderby' => $attributes['orderby'], 'order' => $attributes['order'], 'paged' => $paged, 'meta_query' => array(array('key' => 'visibility', 'value' => array('catalog', 'visible'), 'compare' => 'IN')), 'tax_query' => array(array('taxonomy' => 'product_tag', 'field' => 'slug', 'terms' => $attributes['tag'], 'operator' => $attributes['tax_operator']))); query_posts($args); ob_start(); jigoshop_get_template_part('loop', 'shop'); if ($attributes['pagination']) { do_action('jigoshop_pagination'); } wp_reset_query(); return ob_get_clean(); }
/** * {@inheritdoc} * * Additional available options: * * * alt: an alternative URI to render in case of an error */ public function render($uri, Request $request, array $options = array()) { $reference = null; if ($uri instanceof ControllerReference) { $reference = $uri; $uri = $this->generateFragmentUri($uri, $request); } $subRequest = $this->createSubRequest($uri, $request); // override Request attributes as they can be objects (which are not supported by the generated URI) if (null !== $reference) { $subRequest->attributes->add($reference->attributes); } $level = ob_get_level(); try { return $this->kernel->handle($subRequest, HttpKernelInterface::SUB_REQUEST, false); } catch (\Exception $e) { // let's clean up the output buffers that were created by the sub-request while (ob_get_level() > $level) { ob_get_clean(); } if (isset($options['alt'])) { $alt = $options['alt']; unset($options['alt']); return $this->render($alt, $request, $options); } if (!isset($options['ignore_errors']) || !$options['ignore_errors']) { throw $e; } return new Response(); } }
protected function doDisplay(array $context, array $blocks = array()) { $__internal_2fff3160042f23d812f76a57f2d794df9c0021a111c64efc06751bf3f7b16428 = $this->env->getExtension("native_profiler"); $__internal_2fff3160042f23d812f76a57f2d794df9c0021a111c64efc06751bf3f7b16428->enter($__internal_2fff3160042f23d812f76a57f2d794df9c0021a111c64efc06751bf3f7b16428_prof = new Twig_Profiler_Profile($this->getTemplateName(), "template", "TwigBundle:Exception:traces_text.html.twig")); // line 1 echo "<div class=\"block\">\n <h2>\n Stack Trace (Plain Text) \n "; // line 4 ob_start(); // line 5 echo " <a href=\"#\" onclick=\"toggle('traces-text'); switchIcons('icon-traces-text-open', 'icon-traces-text-close'); return false;\">\n <img class=\"toggle\" id=\"icon-traces-text-close\" alt=\"-\" src=\"data:image/gif;base64,R0lGODlhEgASAMQSANft94TG57Hb8GS44ez1+mC24IvK6ePx+Wa44dXs92+942e54o3L6W2844/M6dnu+P/+/l614P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABIALAAAAAASABIAQAVCoCQBTBOd6Kk4gJhGBCTPxysJb44K0qD/ER/wlxjmisZkMqBEBW5NHrMZmVKvv9hMVsO+hE0EoNAstEYGxG9heIhCADs=\" style=\"display: none\" />\n <img class=\"toggle\" id=\"icon-traces-text-open\" alt=\"+\" src=\"data:image/gif;base64,R0lGODlhEgASAMQTANft99/v+Ga44bHb8ITG52S44dXs9+z1+uPx+YvK6WC24G+944/M6W28443L6dnu+Ge54v/+/l614P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABMALAAAAAASABIAQAVS4DQBTiOd6LkwgJgeUSzHSDoNaZ4PU6FLgYBA5/vFID/DbylRGiNIZu74I0h1hNsVxbNuUV4d9SsZM2EzWe1qThVzwWFOAFCQFa1RQq6DJB4iIQA7\" style=\"display: inline\" />\n </a>\n "; echo trim(preg_replace('/>\\s+</', '><', ob_get_clean())); // line 10 echo " </h2>\n\n <div id=\"traces-text\" class=\"trace\" style=\"display: none;\">\n<pre>"; // line 13 $context['_parent'] = $context; $context['_seq'] = twig_ensure_traversable($this->getAttribute(isset($context["exception"]) ? $context["exception"] : $this->getContext($context, "exception"), "toarray", array())); foreach ($context['_seq'] as $context["i"] => $context["e"]) { // line 14 echo "["; echo twig_escape_filter($this->env, $context["i"] + 1, "html", null, true); echo "] "; echo twig_escape_filter($this->env, $this->getAttribute($context["e"], "class", array()), "html", null, true); echo ": "; echo twig_escape_filter($this->env, $this->getAttribute($context["e"], "message", array()), "html", null, true); echo "\n"; // line 15 $this->loadTemplate("TwigBundle:Exception:traces.txt.twig", "TwigBundle:Exception:traces_text.html.twig", 15)->display(array("exception" => $context["e"])); } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['i'], $context['e'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 16 echo "</pre>\n </div>\n</div>\n"; $__internal_2fff3160042f23d812f76a57f2d794df9c0021a111c64efc06751bf3f7b16428->leave($__internal_2fff3160042f23d812f76a57f2d794df9c0021a111c64efc06751bf3f7b16428_prof); }
function render($view) { $redirecterror = false; if ($this->rendered) { return false; } extract($this->vars); if ($this->request->prefix == COCKPIT) { if (file_exists(ROOT . DS . VIEW . DS . BACKEND . DS . $this->request->controller . DS . $view . '.php')) { $view = ROOT . DS . VIEW . DS . BACKEND . DS . $this->request->controller . DS . $view . '.php'; } elseif (file_exists(ROOT . DS . VIEW . DS . BACKEND . DS . 'extends' . DS . $this->request->controller . DS . $view . '.php')) { $view = ROOT . DS . VIEW . DS . BACKEND . DS . 'extends' . DS . $this->request->controller . DS . $view . '.php'; } else { $redirecterror = true; $view = ROOT . DS . VIEW . DS . $view . '.php'; } } else { if (file_exists(ROOT . DS . VIEW . DS . FRONTEND . DS . $this->request->controller . DS . $view . '.php')) { $view = ROOT . DS . VIEW . DS . FRONTEND . DS . $this->request->controller . DS . $view . '.php'; } elseif (file_exists(ROOT . DS . VIEW . DS . FRONTEND . DS . 'extends' . DS . $this->request->controller . DS . $view . '.php')) { $view = ROOT . DS . VIEW . DS . FRONTEND . DS . 'extends' . DS . $this->request->controller . DS . $view . '.php'; } else { $view = ROOT . DS . VIEW . DS . $view . '.php'; } } ob_start(); require $view; $content_for_layout = ob_get_clean(); if ($this->request->prefix == COCKPIT && $redirecterror == false) { require ROOT . DS . VIEW . DS . BACKEND . DS . 'layout' . DS . COCKPIT . '.php'; } else { require ROOT . DS . VIEW . DS . FRONTEND . DS . 'layout' . DS . $this->layout . '.php'; } $this->rendered = true; }
public function block_toolbar($context, array $blocks = array()) { // line 4 echo " "; ob_start(); // line 5 echo " <span>\n <img width=\"13\" height=\"28\" alt=\"Memory Usage\" src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAcBAMAAABITyhxAAAAJ1BMVEXNzc3///////////////////////8/Pz////////////+NjY0/Pz9lMO+OAAAADHRSTlMAABAgMDhAWXCvv9e8JUuyAAAAQ0lEQVQI12MQBAMBBmLpMwoMDAw6BxjOOABpHyCdAKRzsNDp5eXl1KBh5oHBAYY9YHoDQ+cqIFjZwGCaBgSpBrjcCwCZgkUHKKvX+wAAAABJRU5ErkJggg==\" />\n <span>"; // line 7 echo twig_escape_filter($this->env, sprintf("%.1f", $this->getAttribute(isset($context["collector"]) ? $context["collector"] : $this->getContext($context, "collector"), "memory") / 1024 / 1024), "html", null, true); echo " MB</span>\n </span>\n "; $context["icon"] = '' === ($tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); // line 10 echo " "; ob_start(); // line 11 echo " <div class=\"sf-toolbar-info-piece\">\n <b>Memory usage</b>\n <span>"; // line 13 echo twig_escape_filter($this->env, sprintf("%.1f", $this->getAttribute(isset($context["collector"]) ? $context["collector"] : $this->getContext($context, "collector"), "memory") / 1024 / 1024), "html", null, true); echo " / "; echo $this->getAttribute(isset($context["collector"]) ? $context["collector"] : $this->getContext($context, "collector"), "memoryLimit") == -1 ? "∞" : twig_escape_filter($this->env, sprintf("%.1f", $this->getAttribute(isset($context["collector"]) ? $context["collector"] : $this->getContext($context, "collector"), "memoryLimit") / 1024 / 1024)); echo " MB</span>\n </div>\n "; $context["text"] = '' === ($tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); // line 16 echo " "; $this->env->loadTemplate("@WebProfiler/Profiler/toolbar_item.html.twig")->display(array_merge($context, array("link" => false))); }