public function register($attr, $content = null, $name = null) { $attr = array_map(function ($value) { return str_replace('"', '', $value); }, $attr); return '<iframe ' . \Html::attributes($attr) . '></iframe>'; }
static function renderOptions($options, $default = null, $multiple = False) { $output = ''; $last_group = NULL; foreach ($options as $key => $option) { if ($option->group && $option->group != $last_group) { if ($last_group) { $output .= '</optgroup>' . "\n"; } $output .= '<optgroup label="' . Html::encode($option->group) . '">' . "\n"; $last_group = $option->group; } // is this option selected? $selected = NULL; if ($multiple) { // Do not use type sensitive in_array, due to php int=>str in array keys $selected = $default && in_array($option->value, $default); } else { $selected = $default == $option->value; } $output .= '<option' . Html::attributes(array('value' => $option->value, 'selected' => $selected ? 'selected' : NULL)) . '>' . Html::encode($option->caption) . '</option>' . "\n"; } if ($last_group) { $output .= '</optgroup>' . "\n"; } return $output; }
public static function open($action, $method = 'POST', $attributes = array()) { $attributes['method'] = static::method(strtoupper($method)); $attributes['action'] = static::action($action); if (!array_key_exists('accept-charset', $attributes)) { $attributes['accept-charset'] = Config::app('encoding'); } return '<form' . Html::attributes($attributes) . '>'; }
/** * Renders the Searchbox object to a string. * * @return string */ public function render() { $elements[] = '<div ' . Html::attributes($this->get_option('attributes')) . '>'; $elements[] = Form::input($this->_name . '_searchbox_string', $this->_search_string, $this->get_option('search_field_attributes')); $elements[] = Form::button($this->_name . '_searchbox_string', $this->get_option('search_button_label', __('Search')), $this->get_option('search_button_attributes')); $elements[] = '<div ' . Html::attributes($this->get_option('result_box_attributes')) . '>'; $elements[] = '</div>'; return "\n" . implode("\n", $elements) . "\n"; }
public function register($attr, $content = null, $name = null) { $content = \Shortcode::compile($content); $attr['class'] = 'section ' . str_replace('"', '', isset($attr['class']) ? $attr['class'] : ''); $hr = isset($attr['hr']) ? $attr['hr'] : null; if ($hr) { unset($attr['hr']); $content .= '<hr class="half-rule">'; } return '<div ' . \Html::attributes($attr) . '>' . $content . '</div>'; }
public function render() { $elements[] = '<div ' . Html::attributes($this->get_option('attributes')) . '>'; $col_count = 0; foreach ($this->_data as $key => $item) { $col_count++; $elements[] = View::factory($this->_renderer, $item)->render(); if ($col_count == $this->cols) { $elements[] = '<div style="clear:both;"></div>'; $col_count = 0; } } $elements[] = '</div>'; $elements[] = '<div style="clear:both;"></div>'; return "\n" . implode("\n", $elements) . "\n"; }
public function select($name = '', $options = array(), $selected = '', $_attributes = '', $multiple = false) { if (!is_string($name)) { $name = ''; } if (!isValue($selected)) { $selected = ''; } // Herhangi bir id değeri tanımlanmamışsa // Id değeri olarak isim bilgisini kullan. $id = isset($_attributes["id"]) ? $_attributes["id"] : $name; // Id değer tanımlanmışsa // Id değeri olarak tanımalanan değeri kullan. $id_txt = isset($_attributes["id"]) ? '' : "id=\"{$id}\""; // Son parametrenin durumuna multiple olması belirleniyor. // Ancak bu parametrenin kullanımı gerekmez. // Bunun için multiple() yöntemi oluşturulmuştur. if ($multiple === true) { $multiple = 'multiple="multiple"'; } else { $multiple = ''; } $selectbox = '<select ' . $multiple . ' name="' . $name . '" ' . $id_txt . Html::attributes($_attributes) . '>'; if (is_array($options)) { foreach ($options as $key => $value) { if ($selected == $key) { $select = 'selected="selected"'; } else { $select = ""; } $selectbox .= '<option value="' . $key . '" ' . $select . '>' . $value . '</option>' . eol(); } } $selectbox .= '</select>' . eol(); return $selectbox; }
/** * Generate a Youtube video iframe * * @param null $mixWidth * @param null $height * @return string */ public static function video($mixWidth = null, $height = null) { $defParam = array('width' => 560, 'height' => 315, 'src' => '//www.youtube.com/embed/0af00UcTO-c', 'frameborder' => 0, 'allowfullscreen' => 'true'); $param = array(); if (is_integer($mixWidth)) { $param['width'] = $mixWidth; } if (!$height && is_integer($height)) { $param['height'] = $height; } $param = array_merge($defParam, $param); return '<iframe ' . Html::attributes($param) . '></iframe>'; }
<span><i class="fa fa-spinner fa-lg fa-pulse"></i> Loading..</span> </div> <div class="text-center alert alert-success hide" id="table_success"></div> <script type="text/ng-template" id="exportModal"> <div class="modal-header"> <h3 class="modal-title">[[params.title]]</h3> </div> <div class="modal-body"> <p class="indent"> <em>The data exceed the maximum limit of [[params.limit]] records. Please choose the appropriate range of data to export below.</em> </p> <ul class="list-inline list-unstyled"> <li ng-repeat="item in params.chunks"> <div class="radio"> <label> <input type="radio" name="exportdoc" ng-click="selectItem([[item.from]])"> [[item.from]] - [[item.to]] </label> </div> </li> </ul> </div> <div class="modal-footer"> <button class="btn btn-success" type="button" ng-click="download()">Download</button> <button class="btn btn-warning" type="button" ng-click="cancel()">Cancel</button> </div> </script> </div> <div class="wrapper"> <table class="table table-striped table-condensed table-bordered"' . Html::attributes($options) . '>'; return $html; });
protected function _document($xml = '', $tab = '', $start = 0) { static $start; $eof = eol(); $output = ''; $tab = str_repeat("\t", $start); if (!isset($xml[0])) { $xml = array($xml); $start = 0; } foreach ($xml as $data) { $name = isset($data['name']) ? $data['name'] : ''; $attr = isset($data['attr']) ? $data['attr'] : ''; $content = isset($data['content']) ? $data['content'] : ''; $child = isset($data['child']) ? $data['child'] : ''; $output .= "{$tab}<{$name}" . Html::attributes($attr) . ">"; if (!empty($content)) { $output .= $content; } else { if (!empty($child)) { $output .= $eof . $this->_document($child, $tab, $start++) . $tab; } else { $output .= $content; } } $output .= "</" . $name . ">" . $eof; } return $output; }
public static function button($value = null, $attributes = array()) { return '<button' . Html::attributes($attributes) . '>' . Html::entities($value) . '</button>'; }
public function use(array $randomDataVariable = NULL, array $head = NULL) { if (!empty(Properties::$parameters['headData'])) { $head = Properties::$parameters['headData']; } if (!empty(Properties::$parameters['data'])) { $randomDataVariable = Properties::$parameters['data']; } Properties::$parameters = []; $eol = EOL; $masterPageSet = Config::get('Masterpage'); $randomPageVariable = $head['bodyPage'] ?? $masterPageSet['bodyPage']; $headPage = $head['headPage'] ?? $masterPageSet['headPage']; $docType = $head['docType'] ?? $masterPageSet["docType"]; $header = Config::get('ViewObjects', 'doctype')[$docType] . $eol; $htmlAttributes = $head['attributes']['html'] ?? $masterPageSet['attributes']['html']; $header .= '<html xmlns="http://www.w3.org/1999/xhtml"' . Html::attributes($htmlAttributes) . '>' . $eol; $headAttributes = $head['attributes']['head'] ?? $masterPageSet['attributes']['head']; $header .= '<head' . Html::attributes($headAttributes) . '>' . $eol; $contentCharset = $head['content']['charset'] ?? $masterPageSet['content']['charset']; if (is_array($contentCharset)) { foreach ($contentCharset as $v) { $header .= "<meta http-equiv=\"Content-Type\" content=\"text/html; charset={$v}\">" . $eol; } } else { $header .= '<meta http-equiv="Content-Type" content="text/html; charset=' . $contentCharset . '">' . $eol; } $contentLanguage = $head['content']['language'] ?? $masterPageSet['content']['language']; $header .= '<meta http-equiv="Content-Language" content="' . $contentLanguage . '">' . $eol; $datas = $masterPageSet['data']; $metas = $masterPageSet['meta']; $title = $head['title'] ?? $masterPageSet["title"]; if (!empty($title)) { $header .= '<title>' . $title . '</title>' . $eol; } if (isset($head['meta'])) { $metas = array_merge($metas, $head['meta']); } if (!empty($metas)) { foreach ($metas as $name => $content) { if (isset($head['meta'][$name])) { $content = $head['meta'][$name]; } if (!stristr($name, 'http:') && !stristr($name, 'name:')) { $name = 'name:' . $name; } if (!empty($content)) { $nameEx = explode(":", $name); $httpOrName = $nameEx[0] === 'http' ? 'http-equiv' : 'name'; $name = isset($nameEx[1]) ? $nameEx[1] : $nameEx[0]; if (!is_array($content)) { $header .= "<meta {$httpOrName}=\"{$name}\" content=\"{$content}\">" . $eol; } else { foreach ($content as $key => $val) { $header .= "<meta {$httpOrName}=\"{$name}\" content=\"{$val}\">" . $eol; } } } } } $header .= $this->_links($masterPageSet, $head, 'font'); $header .= $this->_links($masterPageSet, $head, 'script'); $header .= $this->_links($masterPageSet, $head, 'style'); $browserIcon = $head['browserIcon'] ?? $masterPageSet["browserIcon"]; if (!empty($browserIcon) && is_file($browserIcon)) { $header .= '<link rel="shortcut icon" href="' . baseUrl($browserIcon) . '" />' . $eol; } $theme = $head['theme']['name'] ?? $masterPageSet['theme']['name']; $themeRecursive = $head['theme']['recursive'] ?? $masterPageSet['theme']['recursive']; if (!empty($theme)) { $header .= Import::theme($theme, $themeRecursive, true); } $plugin = $head['plugin']['name'] ?? $masterPageSet['plugin']['name']; $pluginRecursive = $head['plugin']['recursive'] ?? $masterPageSet['plugin']['recursive']; if (!empty($plugin)) { $header .= Import::plugin($plugin, $pluginRecursive, true); } if (isset($head['data'])) { $datas = array_merge($datas, $head['data']); } if (!empty($datas)) { if (!is_array($datas)) { $header .= $datas . $eol; } else { foreach ($datas as $v) { $header .= $v . $eol; } } } $header .= $this->_setpage($headPage); $header .= '</head>' . $eol; $backgroundImage = $head['backgroundImage'] ?? $masterPageSet["backgroundImage"]; $bgImage = !empty($backgroundImage) && is_file($backgroundImage) ? ' background="' . baseUrl($backgroundImage) . '" bgproperties="fixed"' : ''; $bodyAttributes = $head['attributes']['body'] ?? $masterPageSet['attributes']['body']; $header .= '<body' . Html::attributes($bodyAttributes) . $bgImage . '>' . $eol; echo $header; if (!empty($randomPageVariable)) { Import::page($randomPageVariable, $randomDataVariable); } $randomFooterVariable = $eol . '</body>' . $eol; $randomFooterVariable .= '</html>'; echo $randomFooterVariable; }
public static function input_html($type = "submit", $name = null, $value = null, $attrs = array()) { return '<input type="' . $type . '"' . Html::attributes($attrs) . ' name="' . $name . '" value="' . Html::encode($value) . '" />' . PHP_EOL; }
/** * Create a HTML page link. * * @param int $page * @param string $text * @param string $class * @return string */ protected function link($page, $text, $class) { $query = '?page=' . $page . $this->appendage($this->appends); return '<li' . Html::attributes(array('class' => $class)) . '><a href="#" onclick="paginationGoPage(' . $page . '); return false;">' . Inflector::utf8($text) . '</a></li>'; }
public function masterPage($randomDataVariable = array(), $head = array()) { if (!empty($this->parameters['headData'])) { $head = $this->parameters['headData']; } if (!empty($this->parameters['data'])) { $randomDataVariable = $this->parameters['data']; } $this->parameters = array(); $eol = eol(); //----------------------------------------------------------------------------------------------------- // Config/Masterpage.php dosyasından ayarlar alınıyor. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< //----------------------------------------------------------------------------------------------------- $masterPageSet = Config::get('Masterpage'); //----------------------------------------------------------------------------------------------------- // Başlık ve vücud sayfaları alınıyor. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< //----------------------------------------------------------------------------------------------------- $randomPageVariable = isset($head['bodyPage']) ? $head['bodyPage'] : $masterPageSet['bodyPage']; $headPage = isset($head['headPage']) ? $head['headPage'] : $masterPageSet['headPage']; $footPage = isset($head['footPage']) ? $head['footPage'] : $masterPageSet['footPage']; //----------------------------------------------------------------------------------------------------- // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //----------------------------------------------------------------------------------------------------- /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>HTML START<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/ $docType = isset($head['docType']) ? $head['docType'] : $masterPageSet["docType"]; $header = Config::get('Doctype', $docType) . $eol; $header .= '<html xmlns="http://www.w3.org/1999/xhtml">' . $eol; /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>HEAD START<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/ $header .= '<head>' . $eol; $contentCharset = isset($head['contentCharset']) ? $head['contentCharset'] : $masterPageSet["contentCharset"]; if (is_array($contentCharset)) { foreach ($contentCharset as $v) { $header .= "<meta http-equiv=\"Content-Type\" content=\"text/html; charset={$v}\">" . $eol; } } else { $header .= '<meta http-equiv="Content-Type" content="text/html; charset=' . $contentCharset . '">' . $eol; } $contentLanguage = isset($head['contentLanguage']) ? $head['contentLanguage'] : $masterPageSet["contentLanguage"]; $header .= '<meta http-equiv="Content-Language" content="' . $contentLanguage . '">' . $eol; //----------------------------------------------------------------------------------------------------- // Data ve Meta verileri alınıyor. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< //----------------------------------------------------------------------------------------------------- $datas = $masterPageSet['data']; $metas = $masterPageSet['meta']; $title = isset($head['title']) ? $head['title'] : $masterPageSet["title"]; //----------------------------------------------------------------------------------------------------- // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //----------------------------------------------------------------------------------------------------- if (!empty($title)) { $header .= '<title>' . $title . '</title>' . $eol; } //----------------------------------------------------------------------------------------------------- // Meta tagları dahil ediliyor. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< //----------------------------------------------------------------------------------------------------- if (isset($head['meta'])) { $metas = array_merge($metas, $head['meta']); } if (!empty($metas)) { foreach ($metas as $name => $content) { if (isset($head['meta'][$name])) { $content = $head['meta'][$name]; } if (!stristr($name, 'http:') && !stristr($name, 'name:')) { $name = 'name:' . $name; } if (!empty($content)) { $nameEx = explode(":", $name); $httpOrName = $nameEx[0] === 'http' ? 'http-equiv' : 'name'; $name = isset($nameEx[1]) ? $nameEx[1] : $nameEx[0]; if (!is_array($content)) { $header .= "<meta {$httpOrName}=\"{$name}\" content=\"{$content}\">" . $eol; } else { foreach ($content as $key => $val) { $header .= "<meta {$httpOrName}=\"{$name}\" content=\"{$val}\">" . $eol; } } } } } //----------------------------------------------------------------------------------------------------- // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //----------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------- // Fontlar dahil ediliyor. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< //----------------------------------------------------------------------------------------------------- if (!empty($masterPageSet["font"])) { $masterPageSet['font'][] = true; $header .= $this->font($masterPageSet["font"], true); } if (isset($head['font'])) { $head['font'][] = true; $header .= $this->font($head['font'], true); } //----------------------------------------------------------------------------------------------------- // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //----------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------- // Javascript kodları dahil ediliyor. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< //----------------------------------------------------------------------------------------------------- if (is_array($masterPageSet['script'])) { $masterPageSet['script'][] = true; $header .= $this->script($masterPageSet['script'], true); } if (isset($head['script'])) { $head['script'][] = true; $header .= $this->script($head['script'], true); } //----------------------------------------------------------------------------------------------------- // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //----------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------- // Stiller dahil ediliyor. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< //----------------------------------------------------------------------------------------------------- if (is_array($masterPageSet['style'])) { $masterPageSet['style'][] = true; $header .= $this->style($masterPageSet['style']); } if (isset($head['style'])) { $head['style'][] = true; $header .= $this->style($head['style']); } //----------------------------------------------------------------------------------------------------- // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //----------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------- // Browser Icon dahil ediliyor. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< //----------------------------------------------------------------------------------------------------- $browserIcon = isset($head['browserIcon']) ? $head['browserIcon'] : $masterPageSet["browserIcon"]; if (!empty($browserIcon)) { $header .= '<link rel="shortcut icon" href="' . baseUrl($browserIcon) . '" />' . $eol; } //----------------------------------------------------------------------------------------------------- // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //----------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------- // Tema dahil ediliyor. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< //----------------------------------------------------------------------------------------------------- $theme = isset($head['theme']['name']) ? $head['theme']['name'] : $masterPageSet['theme']['name']; $themeRecursive = isset($head['theme']['recursive']) ? $head['theme']['recursive'] : $masterPageSet['theme']['recursive']; if (!empty($theme)) { $header .= $this->theme($theme, $themeRecursive, true); } //----------------------------------------------------------------------------------------------------- // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //----------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------- // Eklenti dahil ediliyor. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< //----------------------------------------------------------------------------------------------------- $plugin = isset($head['plugin']['name']) ? $head['plugin']['name'] : $masterPageSet['plugin']['name']; $pluginRecursive = isset($head['plugin']['recursive']) ? $head['plugin']['recursive'] : $masterPageSet['plugin']['recursive']; if (!empty($plugin)) { $header .= $this->plugin($plugin, $pluginRecursive, true); } //----------------------------------------------------------------------------------------------------- // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //----------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------- // Farklı veriler dahil ediliyor. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< //----------------------------------------------------------------------------------------------------- if (isset($head['data'])) { $datas = array_merge($datas, $head['data']); } if (!empty($datas)) { if (!is_array($datas)) { $header .= $datas . $eol; } else { foreach ($datas as $v) { $header .= $v . $eol; } } } //----------------------------------------------------------------------------------------------------- // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //----------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------- // Başlık sayfası dahil ediliyor. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< //----------------------------------------------------------------------------------------------------- $header .= $this->_setpage($headPage); //----------------------------------------------------------------------------------------------------- // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //----------------------------------------------------------------------------------------------------- $header .= '</head>' . $eol; /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>HEAD END<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/ /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>BODY START<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/ //----------------------------------------------------------------------------------------------------- // Arkaplan resmi dahil ediliyor. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< //----------------------------------------------------------------------------------------------------- $backgroundImage = isset($head['backgroundImage']) ? $head['backgroundImage'] : $masterPageSet["backgroundImage"]; $bgImage = !empty($backgroundImage) ? ' background="' . baseUrl($backgroundImage) . '" bgproperties="fixed"' : ''; //----------------------------------------------------------------------------------------------------- // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //----------------------------------------------------------------------------------------------------- $bodyAttributes = isset($head['bodyAttributes']) ? $head['bodyAttributes'] : $masterPageSet["bodyAttributes"]; $header .= '<body' . Html::attributes($bodyAttributes) . $bgImage . '>' . $eol; echo $header; if (!empty($randomPageVariable)) { $this->page($randomPageVariable, $randomDataVariable); } $randomFooterVariable = $eol . '</body>' . $eol; /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>BODY END<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/ $randomFooterVariable .= '</html>'; /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>HTML END<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/ //----------------------------------------------------------------------------------------------------- // Masterpage oluşturuluyor. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< //----------------------------------------------------------------------------------------------------- echo $randomFooterVariable; //----------------------------------------------------------------------------------------------------- // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //----------------------------------------------------------------------------------------------------- }
/** * Returns the rendered head tag * @param boolean echo result * @return string */ public function render($output = false) { // Set content-type header //Header('Content-Type: '.$this->contenttype.';; charset='.$this->charset); if (substr(Kohana::VERSION, 0, 3) == '3.0') { $request = Request::instance(); } else { $request = Request::current(); } $request->headers['Content-Type'] = $this->contenttype . '; charset=' . $this->charset; $html = $this->xhtml_doctype; $html .= '<html' . Html::attributes($this->htmlatts_all) . '>'; $html .= Head::instance(); $html .= '<body>' . $this->body . '</body>'; $html .= '</html>'; // Tidy if (extension_loaded('tidy') and Kohana::config('xhtml.tidy_output')) { $tidyconfig = Kohana::config('xhtml.tidy_config'); //$tidyconfig['output-xml'] = true; $charset = str_replace('-', '', $this->charset); $tidy = new tidy(); $tidy->parseString($html, $tidyconfig, $charset); $tidy->cleanRepair(); $html = (string) $tidy; } //Output if ($output) { echo $html; } return $html; }
/** * Create image * * <code> * echo Html::image('data/files/pic1.jpg'); * </code> * * @param array $attributes Image attributes * @param string $file File * @uses Url::base * @return string */ public static function image($file, array $attributes = null) { if (strpos($file, '://') === FALSE) { $file = Url::base() . '/' . $file; } // Add the image link $attributes['src'] = $file; $attributes['alt'] = isset($attributes['alt']) ? $attributes['alt'] : pathinfo($file, PATHINFO_FILENAME); return '<img' . Html::attributes($attributes) . '>'; }
/** * Returns the rendered head tag * @param boolean echo result * @return string */ public function render($output = false) { $close_single = Xhtml::instance()->is_xhtml ? ' />' : '>'; $html = '<head>'; $html .= '<title>' . $this->title . '</title>'; foreach ($this->meta_extra as $key => $value) { $html .= '<meta' . Html::attributes(array('http-equiv' => $key, 'content' => $value)) . $close_single; } foreach ($this->metas as $key => $value) { $html .= '<meta' . Html::attributes(array('name' => $key, 'content' => $value)) . $close_single; } foreach ($this->links as $value) { $html .= '<link' . Html::attributes($value) . $close_single; } // styles if (Kohana::config('xhtml.cache_styles')) { $html .= Html::style($this->cached_styles); } else { foreach ($this->styles as $value) { $style_file = NULL; $style_atts = array(); $style_cond = NULL; if (is_string($value)) { $style_file = $value; } elseif (is_array($value)) { if (isset($value['file'])) { $style_file = $value['file']; unset($value['file']); } if (isset($value['condition'])) { $style_cond = $value['condition']; unset($value['condition']); } $style_atts = $value; } if ($style_file) { if ($style_cond) { $html .= '<!--[if ' . $style_cond . ']>'; } $html .= Html::style($style_file, $style_atts); if ($style_cond) { $html .= '<![endif]-->'; } } } } // scripts if (Kohana::config('xhtml.cache_scripts')) { $html .= Html::script($this->cached_scripts); } else { foreach ($this->scripts as $file) { $html .= Html::script($file); } foreach ($this->codes as $code) { $html .= '<script' . Html::attributes(array('type' => 'text/javascript')) . '>//<![CDATA[' . "\n" . $code . "\n" . '//]]></script>'; } } $html .= '</head>'; if ($output) { echo $html; } return $html; }
/** * Create a HTML page link. * * @param int $page * @param string $text * @param string $class * @return string */ protected function link($page, $text, $class) { $query = '?' . $this->var . '=' . $page . $this->appendage($this->appends); return '<li' . Html::attributes(array('class' => $class)) . '><a href="' . $query . '">' . Inflector::utf8($text) . '</a></li>'; }
function render(Container $form, $data, $prefix = '') { if ($form->if) { $this->pushStack(new Test($prefix . $form->if), $data); } // Add the forms prefix on $prefix .= $form->prefix; // Group by the form name if it is set if ($form->name) { if (isset($data[$form->name])) { $data = $data[$form->name]; } else { $data = array(); } } // Render the <form> tag if it has an action if ($form->action) { print '<form' . Html::attributes(array('id' => $form->id, 'action' => $form->action, 'method' => $form->method, 'enctype' => $form->upload ? 'multipart/form-data' : NULL)) . '>' . "\n"; // Send a _csrf field with the form print '<input' . Html::attributes(array('type' => 'hidden', 'name' => '_csrf', 'value' => Csrf::generate($form->intent, $form->expire))) . '>' . "\n"; } // Render each of the elements foreach ($form->getElements() as $element) { $this->renderElement($element, $data, $prefix); } // Kill anything remaining on the stack $this->endStack(NULL); // Close the actual form if ($form->action) { print '</form>' . "\n"; } }
/** * Creates a form label. * * <code> * echo Form::label('username', 'Username'); * </code> * * @param string $input Target input * @param string $text Label text * @param array $attributes HTML attributes * @uses Html::attributes * @return string */ public static function label($input, $text, array $attributes = null) { // Set the label target $attributes['for'] = $input; return '<label' . Html::attributes($attributes) . '>' . $text . '</label>'; }
public static function url($field_id, $field_setup) { $field_setup['attr']['type'] = 'text'; $field_setup['attr']['id'] = Form::valid_attr_id($field_id); $field_setup['attr']['name'] = $field_id; $field_setup['attr']['value'] = $field_setup['value']; $field_setup['attr']['class'] = 'singleline_textfield urlfield ' . $field_setup['attr']['class']; $field_setup['attr']['placeholder'] = $field_setup['placeholder']; return '<input' . Html::attributes($field_setup['attr']) . '>' . Html::anchor('', Html::image('system::arrow.png'), array('class' => 'form_url_field_goto', 'rel' => $field_id)); }
public function create() { $table = '<table' . Html::attributes($this->attr) . '>'; $table .= $this->table; $table .= '</table>'; if (!empty($this->table)) { $this->table = NULL; } if (!empty($this->attr)) { $this->attr = array(); } return $table; }
<?php Html::macro('theader', function (array $headers) { $html = '<thead> <tr>'; foreach ($headers as $header) { if (isset($header['sort'])) { $html .= '<th' . Html::attributes(array_except($header, ['name', 'sort'])) . ' class="sortable" ng-click="sort(\'' . $header['sort'] . '\')" id="' . $header['sort'] . '">' . $header['name'] . ' <i class="fa fa-sort"></i></span>'; } else { $html .= '<th' . Html::attributes(array_except($header, ['name', 'sort'])) . '>' . $header['name']; } $html .= '</th>'; } $html .= ' </tr> </thead>'; return $html; });
protected function _mediaContent($src, $content, $_attributes, $type) { if (!is_string($src)) { $src = ''; } if (!isValue($content)) { $content = ''; } return '<' . $type . 'src="' . $src . '"' . Html::attributes($_attributes) . '>' . $content . "</{$type}>" . eol(); }
protected function _input($name = "", $value = "", $_attributes = array(), $type = '') { if ($name !== '') { $_attributes['name'] = $name; } if ($value !== '') { $_attributes['value'] = $value; } if (isset($this->settings['attr'])) { $_attributes = array_merge($this->settings['attr'], (array) $_attributes); } $this->settings = array(); return '<input type="' . $type . '"' . Html::attributes($_attributes) . '>' . eol(); }