/** * Show icon * * @param $name */ public function show($name, $set = '') { $set or $set = self::DEFAULT_SET; $this->sets->{$set} or $this->addSet($set, $this->dir . DS . 'sets' . DS . $set); if ($src = $this->sets->{$set}->get($name)) { $size = explode('x', $this->sets->{$set}->size); return HTML::img($src, t($name, 'Icons'), array('width' => $size[0], 'height' => $size[1])); } }
function run($dbi, $argstr, $request) { extract($this->getArgs($argstr, $request)); // Any text that is returned will not be further transformed, // so use html where necessary. if (empty($jid)) { $html = HTML(); } else { $html = HTML::img(array('src' => urlencode($scripturl) . '&jid=' . urlencode($jid) . '&type=' . urlencode($type) . '&iconset=' . $iconset)); } return $html; }
function folderArrow($id, $init = 'Open') { global $request; if ($cookie = $request->cookies->get("folder_" . $id)) { $init = $cookie; } if ($init == 'Open' or $init == 'Closed') { $png = $this->_findData('images/folderArrow' . $init . '.png'); } else { $png = $this->_findData('images/folderArrowOpen.png'); } return HTML::img(array('id' => $id . '-img', 'src' => $png, 'onclick' => "showHideFolder('{$id}')", 'alt' => _("Click to hide/show"), 'title' => _("Click to hide/show"))); }
function run($dbi, $argstr, &$request, $basepage) { global $WikiTheme; $request->setArg('nocache', 1); $args = $this->getArgs($argstr, $request); // use the "online.tmpl" template // todo: check which arguments are really needed in the template. $stats = $this->getStats($dbi, $request, $args['mode']); if ($src = $WikiTheme->getImageURL("whosonline")) { $img = HTML::img(array('src' => $src, 'alt' => $this->getName())); } else { $img = ''; } $other = array(); $other['ONLINE_ICON'] = $img; return new Template('online', $request, array_merge($args, $stats, $other)); }
public function index($action = NULL) { switch ($action) { case 'file': $tpl = new Template('Upload.file'); $tpl->show(); break; case 'image': $image = new Upload_Image('file', array('preset' => 'post', 'path' => UPLOADS . DS . 'posts' . DS . date('Y/m/d'))); if ($result = $image->upload()) { exit(HTML::img($result)); } break; default: append('content', HTML::a(Url::gear('upload') . '/file?iframe', t('Upload'), array('rel' => 'modal', 'class' => 'button'))); } }
function run($dbi, $argstr, &$request, $basepage) { global $WikiTheme; $args = $this->getArgs($argstr, $request, false); $page =& $args['page']; if (ENABLE_AJAX) { if ($args['state']) { $html = WikiPlugin_IncludePage::run($dbi, $argstr, $request, $basepage); } else { $html = HTML(HTML::p(array('class' => 'transclusion-title'), fmt(" %s :", WikiLink($page))), HTML::div(array('class' => 'transclusion'), '')); } $ajaxuri = WikiURL($page, array('format' => 'xml')); } else { $html = WikiPlugin_IncludePage::run($dbi, $argstr, $request, $basepage); } $header = $html->_content[0]; $body = $html->_content[1]; $id = 'DynInc-' . MangleXmlIdentifier($page); $body->setAttr('id', $id . '-body'); $png = $WikiTheme->_findData('images/folderArrow' . ($args['state'] ? 'Open' : 'Closed') . '.png'); $icon = HTML::img(array('id' => $id . '-img', 'src' => $png, 'onclick' => ENABLE_AJAX ? "showHideAsync('" . $ajaxuri . "','{$id}')" : "showHideFolder('{$id}')", 'alt' => _("Click to hide/show"), 'title' => _("Click to hide/show"))); $header = HTML::p(array('class' => 'transclusion-title', 'style' => "text-decoration: none;"), $icon, fmt(" %s :", WikiLink($page))); if ($args['state']) { // show base $body->setAttr('style', 'display:block'); return HTML($header, $body); } else { // do not show base $body->setAttr('style', 'display:none'); if (ENABLE_AJAX) { return HTML($header, $body); } else { return HTML($header, $body); } // sync (load but display:none) } }
function OptionsButtonBars($plugin_args) { $this->__construct('fieldset', array('class' => 'wiki-rc-action')); // Add ShowHideFolder button $icon = $GLOBALS['WikiTheme']->_findData('images/folderArrowOpen.png'); $img = HTML::img(array('id' => 'rc-action-img', 'src' => $icon, 'onclick' => "showHideFolder('rc-action')", 'alt' => _("Click to hide/show"), 'title' => _("Click to hide/show"))); // Display selection buttons extract($plugin_args); // Custom caption if (!$caption) { $caption = _("Show changes for:"); } $this->pushContent(HTML::legend($caption, ' ', $img)); $table = HTML::table(array('id' => 'rc-action-body', 'style' => 'display:block')); $tr = HTML::tr(); foreach (explode(",", $daylist) as $days_button) { $tr->pushContent($this->_makeDayButton($days_button, $days)); } $table->pushContent($tr); $tr = HTML::tr(); $tr->pushContent($this->_makeUsersButton(0)); $tr->pushContent($this->_makeUsersButton(1)); $table->pushContent($tr); $tr = HTML::tr(); $tr->pushContent($this->_makePagesButton(0)); $tr->pushContent($this->_makePagesButton(1)); $table->pushContent($tr); $tr = HTML::tr(); $tr->pushContent($this->_makeMinorButton(1, $show_minor)); $tr->pushContent($this->_makeMinorButton(0, $show_minor)); $table->pushContent($tr); $tr = HTML::tr(); $tr->pushContent($this->_makeShowAllButton(1, $show_all)); $tr->pushContent($this->_makeShowAllButton(0, $show_all)); $table->pushContent($tr); $tr = HTML::tr(); $tr->pushContent($this->_makeNewPagesButton(0, $only_new)); $tr->pushContent($this->_makeNewPagesButton(1, $only_new)); $table->pushContent($tr); $this->pushContent($table); }
function getDocumentPath($id, $group_id, $referrer_id = null) { $parents = array(); $html = HTML(); $hp =& Codendi_HTMLPurifier::instance(); $item_factory =& $this->_getItemFactory($group_id); $item =& $item_factory->getItemFromDb($id); $reference =& $item; if ($reference && $referrer_id != $id) { while ($item && $item->getParentId() != 0) { $item =& $item_factory->getItemFromDb($item->getParentId()); $parents[] = array('id' => $item->getId(), 'title' => $item->getTitle()); } $parents = array_reverse($parents); $item_url = '/plugins/docman/?group_id=' . $group_id . '&sort_update_date=0&action=show&id='; foreach ($parents as $parent) { $html->pushContent(HTML::a(array('href' => $item_url . $parent['id'], 'target' => '_blank'), HTML::strong($parent['title']))); $html->pushContent(' / '); } $md_uri = '/plugins/docman/?group_id=' . $group_id . '&action=details&id=' . $id; //Add a pen icon linked to document properties. $pen_icon = HTML::a(array('href' => $md_uri), HTML::img(array('src' => util_get_image_theme("ic/edit.png")))); $html->pushContent(HTML::a(array('href' => $item_url . $reference->getId()), HTML::strong($reference->getTitle()))); $html->pushContent($pen_icon); $html->pushContent(HTML::br()); } return $html; }
$i = 0; foreach ($nodes as $node) { ?> <?php if ($i != 0 && $i % 3 == 0) { ?> </div><div class="clearfix"> <?php } ?> <div class="col-lg-4"> <div class="thumbnail"> <?php echo HTML::a(Yii::$app->imageCache->thumb($node->image, 'post'), ['product/view', 'slug' => $node->slug]); ?> </div> <h5 class="grid-product-title"><?php echo HTML::a($node->title, ['product/view', 'slug' => $node->slug]); ?> </h5> </div><!--One Item--> <?php $i++; } ?> </div> <div class="text-center"> <?php echo HTML::a(HTML::img('img/icon-xem-them.png'), ['category/view', 'slug' => $category_slug]); ?> </div>
<div id="container"> <div id="header"> <?php echo HTML::link('', HTML::img('images/yawf-240x50.png', array('width' => 240, 'height' => 50, 'alt' => 'YAWF'))); ?> <div id="login"> <p><strong><?php echo $greeting; ?> </strong> <?php echo HTML::link('admin/login', 'Log in'); ?> or <?php echo HTML::link('admin/sign_up', 'sign up'); ?> to get involved.</p> </div> </div> <div id="menu"> <ul> <li<?php echo array_key($active_tab, 'default/index'); ?> ><?php echo HTML::link("default", 'Welcome'); ?> </li> <li<?php echo array_key($active_tab, 'project/news');
/** * HTML widget display * * This needs to be put in the <body> section of the page. * * @param pagename Name of the page to rate * @param version Version of the page to rate (may be "" for current) * @param imgPrefix Prefix of the names of the images that display the rating * You can have two widgets for the same page displayed at * once iff the imgPrefix-s are different. * @param dimension Id of the dimension to rate * @param small Makes a smaller ratings widget if non-false * * Limitations: Currently this can only print the current users ratings. * And only the widget, but no value (for buddies) also. */ function RatingWidgetHtml($pagename, $version, $imgPrefix, $dimension, $small = false) { global $WikiTheme, $request; $imgId = MangleXmlIdentifier($pagename) . $imgPrefix; $actionImgName = $imgId . 'RateItAction'; $dbi =& $GLOBALS['request']->_dbi; $version = $dbi->_backend->get_latest_version($pagename); //$rdbi =& $this->_rdbi; $rdbi = RatingsDb::getTheRatingsDb(); // check if the imgPrefix icons exist. if (!$WikiTheme->_findData("images/RateIt" . $imgPrefix . "Nk0.png", true)) { $imgPrefix = ''; } // Protect against 's, though not \r or \n $reImgPrefix = $this->_javascript_quote_string($imgPrefix); $reActionImgName = $this->_javascript_quote_string($actionImgName); $rePagename = $this->_javascript_quote_string($pagename); //$dimension = $args['pagename'] . "rat"; $html = HTML::span(array("id" => $imgId)); for ($i = 0; $i < 2; $i++) { $nk[$i] = $WikiTheme->_findData("images/RateIt" . $imgPrefix . "Nk" . $i . ".png"); $none[$i] = $WikiTheme->_findData("images/RateIt" . $imgPrefix . "Rk" . $i . ".png"); } $user = $request->getUser(); $userid = $user->getId(); //if (!isset($args['rating'])) $rating = $rdbi->getRating($userid, $pagename, $dimension); if (!$rating) { $pred = $rdbi->getPrediction($userid, $pagename, $dimension); } for ($i = 1; $i <= 10; $i++) { $a1 = HTML::a(array('href' => 'javascript:click(\'' . $reActionImgName . '\',\'' . $rePagename . '\',\'' . $version . '\',\'' . $reImgPrefix . '\',\'' . $dimension . '\',' . $i / 2 . ')')); $img_attr = array(); $img_attr['src'] = $nk[$i % 2]; //if (!$rating and !$pred) // $img_attr['src'] = $none[$i%2]; $img_attr['name'] = $imgPrefix . $i; $img_attr['alt'] = $img_attr['name']; $img_attr['border'] = 0; $a1->pushContent(HTML::img($img_attr)); $a1->addToolTip(_("Rate the topic of this page")); $html->pushContent($a1); //This adds a space between the rating smilies: // if (($i%2) == 0) $html->pushContent(' '); } $html->pushContent(HTML::Raw(' ')); $a0 = HTML::a(array('href' => 'javascript:click(\'' . $reActionImgName . '\',\'' . $rePagename . '\',\'' . $version . '\',\'' . $reImgPrefix . '\',\'' . $dimension . '\',\'X\')')); $msg = _("Cancel rating"); $a0->pushContent(HTML::img(array('src' => $WikiTheme->getImageUrl("RateIt" . $imgPrefix . "Cancel"), 'name' => $imgPrefix . 'Cancel', 'alt' => $msg))); $a0->addToolTip($msg); $html->pushContent($a0); /*} elseif ($pred) { $msg = _("No opinion"); $html->pushContent(HTML::img(array('src' => $WikiTheme->getImageUrl("RateItCancelN"), 'name'=> $imgPrefix.'Cancel', 'alt' => $msg))); //$a0->addToolTip($msg); //$html->pushContent($a0); }*/ $img_attr = array(); $img_attr['src'] = $WikiTheme->_findData("images/RateItAction.png"); $img_attr['name'] = $actionImgName; $img_attr['alt'] = $img_attr['name']; //$img_attr['class'] = 'k' . $i; $img_attr['border'] = 0; $html->pushContent(HTML::img($img_attr)); // Display the current rating if there is one if ($rating) { $html->pushContent(JavaScript('displayRating(\'' . $reImgPrefix . '\',' . $rating . ',0)')); } elseif ($pred) { $html->pushContent(JavaScript('displayRating(\'' . $reImgPrefix . '\',' . $pred . ',1)')); } else { $html->pushContent(JavaScript('displayRating(\'' . $reImgPrefix . '\',0,0)')); } return $html; }
function templatePulldown($query, $case_exact = false, $regex = 'auto') { global $request; require_once 'lib/TextSearchQuery.php'; $dbi =& $request->_dbi; $page_iter = $dbi->titleSearch(new TextSearchQuery($query, $case_exact, $regex)); $count = 0; if ($page_iter->count()) { global $WikiTheme; $pages_js = ''; while ($p = $page_iter->next()) { $rev = $p->getCurrentRevision(); $toinsert = str_replace(array("\n", '"'), array('_nl', '_quot'), $rev->_get_content()); //$toinsert = str_replace("\n",'\n',addslashes($rev->_get_content())); $pages_js .= ",['" . $p->getName() . "','_nl{$toinsert}']"; } $pages_js = substr($pages_js, 1); if (!empty($pages_js)) { return HTML("\n", HTML::img(array('class' => "toolbar", 'id' => 'tb-templates', 'src' => $WikiTheme->getImageURL("ed_template.png"), 'title' => _("AddTemplate"), 'alt' => _("AddTemplate"), 'onclick' => "showPulldown('" . _("Insert Template") . "',[" . $pages_js . "],'" . _("Insert") . "','" . _("Close") . "','tb-templates')"))); } } return ''; }
function text2png($text, $l) { /** * Basic image creation and caching * * You MUST delete the image cache yourself in /images if you * change the drawing routines! */ $filename = $text . ".png"; /** * FIXME: need something more elegant, and a way to gettext a * different language depending on any individual * user's locale preferences. */ if ($l == "C") { $l = "en"; } //english=C $filepath = getcwd() . "/images/{$l}"; if (!file_exists($filepath . "/" . $filename)) { if (!file_exists($filepath)) { $oldumask = umask(0); // permissions affected by user the www server is running as mkdir($filepath, 0777); umask($oldumask); } // add trailing slash to save some keystrokes later $filepath .= "/"; /** * prepare a new image * * FIXME: needs a dynamic image size depending on text * width and height */ $im = @ImageCreate(150, 50); if (empty($im)) { $error_html = _("PHP was unable to create a new GD image stream. Read 'lib/plugin/text2png.php' for details."); // FIXME: Error manager does not transform URLs passed // through it. $link = "http://www.php.net/manual/en/function.imagecreate.php"; $error_html .= sprintf(_("See %s"), $link) . "."; trigger_error($error_html, E_USER_NOTICE); return; } // get ready to draw $bg_color = ImageColorAllocate($im, 255, 255, 255); $ttfont = "/System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Home/lib/fonts/LucidaSansRegular.ttf"; /* http://download.php.net/manual/en/function.imagettftext.php * array imagettftext (int im, int size, int angle, int x, int y, * int col, string fontfile, string text) */ // draw shadow $text_color = ImageColorAllocate($im, 175, 175, 175); // shadow is 1 pixel down and 2 pixels right ImageTTFText($im, 10, 0, 12, 31, $text_color, $ttfont, $text); // draw text $text_color = ImageColorAllocate($im, 0, 0, 0); ImageTTFText($im, 10, 0, 10, 30, $text_color, $ttfont, $text); /** * An alternate text drawing method in case ImageTTFText * doesn't work. **/ //ImageString($im, 2, 10, 40, $text, $text_color); // To dump directly to browser: //header("Content-type: image/png"); //ImagePng($im); // to save to file: $success = ImagePng($im, $filepath . $filename); } else { $filepath .= "/"; $success = 2; } // create an <img src= tag to show the image! $html = HTML(); if ($success > 0) { if (defined('text2png_debug')) { switch ($success) { case 1: trigger_error(sprintf(_("Image saved to cache file: %s"), $filepath . $filename), E_USER_NOTICE); case 2: trigger_error(sprintf(_("Image loaded from cache file: %s"), $filepath . $filename), E_USER_NOTICE); } } $url = "images/{$l}/{$filename}"; if (defined('DATA_PATH')) { $url = DATA_PATH . "/{$url}"; } $html->pushContent(HTML::img(array('src' => $url, 'alt' => $text))); } else { trigger_error(sprintf(_("couldn't open file '%s' for writing"), $filepath . $filename), E_USER_NOTICE); } return $html; }
function run($dbi, $argstr, &$request, $basepage) { global $WikiTheme; $args = $this->getArgs($argstr, $request); extract($args); if ($since) { $since = strtotime($since); } if ($month) { $since = strtotime($month); $since = mktime(0, 0, 0, date("m", $since), 1, date("Y", $since)); $until = mktime(23, 59, 59, date("m", $since) + 1, 0, date("Y", $since)); } else { $until = 0; } $iter = $dbi->getAllPages(false, '-mtime'); $pages = array(); while ($page = $iter->next()) { $pagename = $page->getName(); if (!$page->exists()) { continue; } $rev = $page->getRevision(1, false); $date = $rev->get('mtime'); //$author = $rev->get('author_id'); $author = $page->getOwner(); if (defined('DEBUG') && DEBUG && $debug) { echo "<i>{$pagename}, ", strftime("%Y-%m-%d %h:%m:%s", $date), ", {$author}</i><br />\n"; } if ($userid and !preg_match("/" . $userid . "/", $author)) { continue; } if ($since and $date < $since) { continue; } if ($until and $date > $until) { continue; } if (!$comments and preg_match("/\\/Comment/", $pagename)) { continue; } $monthnum = strftime("%Y%m", $date); if (!isset($pages[$monthnum])) { $pages[$monthnum] = array('author' => array(), 'month' => strftime("%B, %Y", $date)); } if (!isset($pages[$monthnum]['author'][$author])) { $pages[$monthnum]['author'][$author] = array('count' => 0, 'pages' => array()); } $pages[$monthnum]['author'][$author]['count']++; $pages[$monthnum]['author'][$author]['pages'][] = $pagename; } $iter->free(); $html = HTML::table(HTML::col(array('span' => 2, 'align' => 'left'))); $nbsp = HTML::raw(' '); krsort($pages); foreach ($pages as $monthname => $parr) { $html->pushContent(HTML::tr(HTML::td(array('colspan' => 2), HTML::strong($parr['month'])))); uasort($parr['author'], 'cmp_by_count'); foreach ($parr['author'] as $user => $authorarr) { $count = $authorarr['count']; $id = preg_replace("/ /", "_", 'pages-' . $monthname . '-' . $user); $html->pushContent(HTML::tr(HTML::td($nbsp, $nbsp, HTML::img(array('id' => "{$id}-img", 'src' => $WikiTheme->_findData("images/folderArrowClosed.png"), 'onclick' => "showHideFolder('{$id}')", 'alt' => _("Click to hide/show"), 'title' => _("Click to hide/show"))), $nbsp, $user), HTML::td($count))); if ($links) { $pagelist = HTML(); foreach ($authorarr['pages'] as $p) { $pagelist->pushContent(WikiLink($p), ', '); } } else { $pagelist = join(', ', $authorarr['pages']); } $html->pushContent(HTML::tr(array('id' => $id . '-body', 'style' => 'display:none; background-color: #eee;'), HTML::td(array('colspan' => 2, 'style' => 'font-size:smaller'), $pagelist))); } } return $html; }
<?if($value):?> <div class="image-preview"><?php echo HTML::img($value, '', $image); ?> <a href="<?php echo Ajax::link(array('action' => 'replace', 'form' => $form->name, 'element' => $element->name)); ?> " class="form-action delete">x</a></div> <?endif;?> <?php echo HTML::input($attributes);
function text2png($args) { extract($args); /** * Basic image creation and caching * * You MUST delete the image cache yourself in /images if you * change the drawing routines! */ $filename = urlencode($text) . ".png"; // protect by urlencode!!! /** * FIXME: need something more elegant, and a way to gettext a * different language depending on any individual * user's locale preferences. */ if ($l == "C") { $l = "en"; //english=C } else { $l = urlencode($l); // who on earth forgot his? } $basedir = "text2png-image"; $filepath = getUploadFilePath() . "{$basedir}/{$l}"; if ($_force or !file_exists($filepath . $filename)) { if (!file_exists($filepath)) { $oldumask = umask(0); // permissions affected by user the www server is running as mkdir(getUploadFilePath() . $basedir, 0777); mkdir($filepath, 0777); umask($oldumask); } $filepath .= "/"; /** * prepare a new image * * FIXME: needs a dynamic image size depending on text * width and height */ // got this logic from GraphViz if (defined('TTFONT')) { $ttfont = TTFONT; } elseif (PHP_OS == "Darwin") { // Mac OS X $ttfont = "/System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Home/lib/fonts/LucidaSansRegular.ttf"; } elseif (isWindows()) { $ttfont = $_ENV['windir'] . '\\Fonts\\Arial.ttf'; } else { $ttfont = 'luximr'; // This is the only what sourceforge offered. //$ttfont = 'Helvetica'; } /* http://download.php.net/manual/en/function.imagettftext.php * array imagettftext (int im, int size, int angle, int x, int y, * int col, string fontfile, string text) */ // get ready to draw $s = ImageTTFBBox($fontsize, 0, $ttfont, $text); $im = @ImageCreate(abs($s[4]) + 20, abs($s[7]) + 10); if (empty($im)) { $error_html = _("PHP was unable to create a new GD image stream. Read 'lib/plugin/text2png.php' for details."); // FIXME: Error manager does not transform URLs passed // through it. $link = "http://www.php.net/manual/en/function.imagecreate.php"; $error_html .= sprintf(_("See %s"), $link) . "."; trigger_error($error_html, E_USER_NOTICE); return; } $rgb = $this->hexcolor($backcolor, array(255, 255, 255)); $bg_color = ImageColorAllocate($im, $rgb[0], $rgb[1], $rgb[2]); if ($with_shadow) { $rgb = $this->hexcolor($shadowcolor, array(175, 175, 175)); $text_color = ImageColorAllocate($im, $rgb[0], $rgb[1], $rgb[2]); // shadow is 1 pixel down and 2 pixels right ImageTTFText($im, $fontsize, 0, 12, abs($s[7]) + 6, $text_color, $ttfont, $text); } // draw text $rgb = $this->hexcolor($fontcolor, array(0, 0, 0)); $text_color = ImageColorAllocate($im, $rgb[0], $rgb[1], $rgb[2]); ImageTTFText($im, $fontsize, 0, 10, abs($s[7]) + 5, $text_color, $ttfont, $text); /** * An alternate text drawing method in case ImageTTFText * doesn't work. **/ //ImageString($im, 2, 10, 40, $text, $text_color); // To dump directly to browser: //header("Content-type: image/png"); //ImagePng($im); // to save to file: $success = ImagePng($im, $filepath . $filename); } else { $filepath .= "/"; $success = 2; } // create an <img src= tag to show the image! $html = HTML(); if ($success > 0) { if (defined('text2png_debug')) { switch ($success) { case 1: trigger_error(sprintf(_("Image saved to cache file: %s"), $filepath . $filename), E_USER_NOTICE); case 2: trigger_error(sprintf(_("Image loaded from cache file: %s"), $filepath . $filename), E_USER_NOTICE); } } $url = getUploadDataPath() . "{$basedir}/" . urlencode($l) . "/" . urlencode($filename); $html->pushContent(HTML::img(array('src' => $url, 'alt' => $text, 'title' => '"' . $text . '"' . _(" produced by ") . $this->getName()))); } else { trigger_error(sprintf(_("couldn't open file '%s' for writing"), $filepath . $filename), E_USER_NOTICE); } return $html; }
/** * Inline Images * * Syntax: [image.png size=50% border=n align= hspace= vspace= width= height=] * Disallows sizes which are too small. * Spammers may use such (typically invisible) image attributes to raise their GoogleRank. * * Handle embeddable objects, like svg, class, vrml, swf, svgz, pdf, avi, wmv especially. */ function LinkImage($url, $alt = "") { $force_img = "png|jpg|gif|jpeg|bmp|pl|cgi"; // Disallow tags in img src urls. Typical CSS attacks. // FIXME: Is this needed (or sufficient?) // FIXED: This was broken for moniker:TP30 test/image.png => url="moniker:TP30" attr="test/image.png" $ori_url = $url; // support new syntax: [prefix/image.jpg size=50% border=n] if (empty($alt)) { $alt = ""; } // Extract URL $arr = explode(' ', $url); if (!empty($arr)) { $url = $arr[0]; } if (!IsSafeURL($url)) { $link = HTML::span(array('class' => 'error'), _("BAD URL -- remove all of <, >, \"")); return $link; } // spaces in inline images must be %20 encoded! $link = HTML::img(array('src' => $url)); // Extract attributes $arr = parse_attributes(strstr($ori_url, " ")); foreach ($arr as $attr => $value) { // These attributes take strings: lang, id, title, alt if ($attr == "lang" || $attr == "id" || $attr == "title" || $attr == "alt") { $link->setAttr($attr, $value); } elseif ($attr == "align" && ($value == "bottom" || $value == "middle" || $value == "top" || $value == "left" || $value == "right")) { $link->setAttr($attr, $value); } elseif (($attr == "border" || $attr == "hspace" || $attr == "vspace") && is_numeric($value)) { $link->setAttr($attr, (int) $value); } elseif (($attr == "height" || $attr == "width") && preg_match('/\\d+[%p]?x?/', $value)) { $link->setAttr($attr, $value); } elseif ($attr == "size") { if (preg_match('/(\\d+%)/', $value, $m)) { $link->setAttr('width', $m[1]); $link->setAttr('height', $m[1]); } elseif (preg_match('/(\\d+)x(\\d+)/', $value, $m)) { $link->setAttr('width', $m[1]); $link->setAttr('height', $m[2]); } } else { $link = HTML::span(array('class' => 'error'), sprintf(_("Invalid image attribute \"%s\" %s=%s"), $url, $attr, $value)); return $link; } } // Correct silently the most common error if ($url != $ori_url and empty($arr) and !preg_match("/^http/", $url)) { // space belongs to the path $file = NormalizeLocalFileName($ori_url); if (file_exists($file)) { $link = HTML::img(array('src' => $ori_url)); trigger_error(sprintf(_("Invalid image link fixed %s => %s. Spaces must be quoted with %%20."), $url, $ori_url), E_USER_WARNING); } elseif (string_starts_with($ori_url, getUploadDataPath())) { $file = substr($file, strlen(getUploadDataPath())); $path = getUploadFilePath() . $file; if (file_exists($path)) { trigger_error(sprintf(_("Invalid image link fixed \"%s\" => \"%s\".\n Spaces must be quoted with %%20."), $url, $ori_url), E_USER_WARNING); $link->setAttr('src', getUploadDataPath() . $file); $url = $ori_url; } } } if (!$link->getAttr('alt')) { $link->setAttr('alt', $alt); } // Check width and height as spam countermeasure if ($width = $link->getAttr('width') and $height = $link->getAttr('height')) { //$width = (int) $width; // px or % or other suffix //$height = (int) $height; if ($width < 3 and $height < 10 or $height < 3 and $width < 20 or $height < 7 and $width < 7) { $link = HTML::span(array('class' => 'error'), _("Invalid image size")); return $link; } } else { $size = 0; // Prepare for getimagesize($url) // $url only valid for external urls, otherwise local path if (DISABLE_GETIMAGESIZE) { } elseif (!preg_match("/\\.{$force_img}\$/i", $url)) { } elseif (preg_match("/^http/", $url)) { // external url $size = @getimagesize($url); } else { // local file if (file_exists($file = NormalizeLocalFileName($url))) { // here $size = @getimagesize($file); } elseif (file_exists(NormalizeLocalFileName(urldecode($url)))) { $size = @getimagesize($file); $link->setAttr('src', rawurldecode($url)); } elseif (string_starts_with($url, getUploadDataPath())) { // there $file = substr($file, strlen(getUploadDataPath())); $path = getUploadFilePath() . rawurldecode($file); $size = @getimagesize($path); $link->setAttr('src', getUploadDataPath() . rawurldecode($file)); } else { // elsewhere global $request; $size = @getimagesize($request->get('DOCUMENT_ROOT') . urldecode($url)); } } if ($size) { $width = $size[0]; $height = $size[1]; if ($width < 3 and $height < 10 or $height < 3 and $width < 20 or $height < 7 and $width < 7) { $link = HTML::span(array('class' => 'error'), _("Invalid image size")); return $link; } } } $link->setAttr('class', 'inlineimage'); /* Check for inlined objects. Everything allowed in INLINE_IMAGES besides * png|jpg|gif|jpeg|bmp|pl|cgi. If no image it is an object to embed. * Note: Allow cgi's (pl,cgi) returning images. */ if (!preg_match("/\\.(" . $force_img . ")/i", $url)) { // HTML::img(array('src' => $url, 'alt' => $alt, 'title' => $alt)); // => HTML::object(array('src' => $url)) ...; return ImgObject($link, $ori_url); } return $link; }
<?php use yii\helpers\Html; ?> <div class="owl-carousel"> <?php foreach ($nodes as $node) { ?> <?php echo HTML::a(HTML::img($node->image, ['class' => 'img-responsive']), $node->link); ?> <?php } ?> </div> <?php $js = ' $(document).ready(function(){ $(".owl-carousel").owlCarousel({ items: 1, loop: true, center: true, autoPlay: true, dots: true, transitionStyle : "fade", singleItem: true, itemsScaleUp : true, }); }); ';
function bar($percent) { global $WikiTheme; return HTML(HTML::img(array('src' => $WikiTheme->getImageUrl('leftbar'), 'alt' => '<')), HTML::img(array('src' => $WikiTheme->getImageUrl('mainbar'), 'alt' => '-', 'width' => sprintf("%02d", $percent), 'height' => 14)), HTML::img(array('src' => $WikiTheme->getImageUrl('rightbar'), 'alt' => '>'))); }
function run($dbi, $argstr, &$request, $basepage) { // When 'phpweather/phpweather.php' is not installed then // PHPWEATHER_BASE_DIR will be undefined. if (!defined('PHPWEATHER_BASE_DIR')) { return $this->error(_("You have to define PHPWEATHER_BASE_DIR before use. (config/config.ini)")); } //early return require_once PHPWEATHER_BASE_DIR . '/output/pw_images.php'; require_once PHPWEATHER_BASE_DIR . '/pw_utilities.php'; extract($this->getArgs($argstr, $request)); $html = HTML(); $w = new phpweather(); // Our weather object if (!empty($icao)) { /* We assign the ICAO to the weather object: */ $w->set_icao($icao); if (!$w->get_country_code()) { /* The country code couldn't be resolved, so we * shouldn't use the ICAO: */ trigger_error(sprintf(_("The ICAO '%s' wasn't recognized."), $icao), E_USER_NOTICE); $icao = ''; } } if (!empty($icao)) { /* We check and correct the language if necessary: */ //if (!in_array($language, array_keys($w->get_languages('text')))) { if (!in_array($language, array_keys(get_languages('text')))) { trigger_error(sprintf(_("%s does not know about the language '%s', using 'en' instead."), $this->getName(), $language), E_USER_NOTICE); $language = 'en'; } $class = "pw_text_{$language}"; require_once PHPWEATHER_BASE_DIR . "/output/{$class}.php"; $t = new $class($w); $t->set_pref_units($units); $i = new pw_images($w); $i_temp = HTML::img(array('src' => $i->get_temp_image())); $i_wind = HTML::img(array('src' => $i->get_winddir_image())); $i_sky = HTML::img(array('src' => $i->get_sky_image())); $m = $t->print_pretty(); $m_td = HTML::td(HTML::p(new RawXml($m))); $i_tr = HTML::tr(); $i_tr->pushContent(HTML::td($i_temp)); $i_tr->pushContent(HTML::td($i_wind)); $i_table = HTML::table($i_tr); $i_table->pushContent(HTML::tr(HTML::td(array('colspan' => '2'), $i_sky))); $tr = HTML::tr(); $tr->pushContent($m_td); $tr->pushContent(HTML::td($i_table)); $html->pushContent(HTML::table($tr)); } /* We make a menu if asked to, or if $icao is empty: */ if ($menu || empty($icao)) { $form_arg = array('action' => $request->getURLtoSelf(), 'method' => 'get'); /* The country box is always part of the menu: */ $p1 = HTML::p(new RawXml(get_countries_select($w, $cc))); /* We want to save the language: */ $p1->pushContent(HTML::input(array('type' => 'hidden', 'name' => 'language', 'value' => $language))); /* And also the ICAO: */ $p1->pushContent(HTML::input(array('type' => 'hidden', 'name' => 'icao', 'value' => $icao))); $caption = empty($cc) ? _("Submit country") : _("Change country"); $p1->pushContent(HTML::input(array('type' => 'submit', 'value' => $caption))); $html->pushContent(HTML::form($form_arg, $p1)); if (!empty($cc)) { /* We have selected a country, now display a list with * the available stations in that country: */ $p2 = HTML::p(); /* We need the country code after the form is submitted: */ $p2->pushContent(HTML::input(array('type' => 'hidden', 'name' => 'cc', 'value' => $cc))); $p2->pushContent(new RawXml(get_stations_select($w, $cc, $icao))); $p2->pushContent(new RawXml(get_languages_select($language))); $p2->pushContent(HTML::input(array('type' => 'submit', 'value' => _("Submit location")))); $html->pushContent(HTML::form($form_arg, $p2)); } } return $html; }
<?php use yii\helpers\Html; ?> <div class="container"> <div class="row"> <div class="col-lg-12"> <div class="homepage-category homepage-category-small theme-denim"> <div class="category-item-title"> <h2> <i class="fa fa-shopping-cart"></i> <span>Sản phẩm</span> </h2> </div> <div class="temp-wrapper"> <?php foreach ($nodes as $node) { ?> <?php echo HTML::a(HTML::img($node->image), $node->link); ?> <?php } ?> </div> </div> </div> </div> </div>
/** * Render avatar * * @param string $file */ public function render($preset = 'avatar.small') { $file = UPLOADS . '/' . $this->file; return HTML::img(Url::toUri(image_preset($preset, $file)), $this->object->login, array('class' => 'avatar')); }
<?php $this->head(); ?> </head> <body> <?php $this->beginBody(); ?> <div class="wrap"> <header class="header"> <div class="container"> <div class="row"> <div class="col-lg-3"> <?php echo HTML::a(HTML::img('/img/logo.png', ['height' => '80']), ['site/index'], ['title' => 'Phụ tùng máy xây dựng']); ?> </div> <div class="col-lg-3"> <div class="phone"><i class="fa fa-phone-square"></i> <div class="phone-box"><strong>Hỗ trợ phụ tùng xe ô tô con</strong><br><span>0981 553 639</span></div> </div> </div> <div class="col-lg-3"> <div class="phone"><i class="fa fa-phone-square"></i> <div class="phone-box"><strong>Hỗ trợ phụ tùng xe ô tô tải</strong><br><span>0975 555 529</span></div> </div> </div> <div class="col-lg-3"> <div class="phone"><i class="fa fa-phone-square"></i> <div class="phone-box"><strong>Hỗ trợ phụ tùng máy xây dựng</strong><br><span>0913 580 191 - 0985 163 667</span></div>
function run($dbi, $argstr, &$request, $basepage) { extract($this->getArgs($argstr, $request)); $attributes = $attrib ? explode(",", $attrib) : array(); $photos = array(); $html = HTML(); $count = 0; // check all parameters // what type do we have? if (!$src) { $showdesc = 'none'; $src = $request->getArg('pagename'); $error = $this->fromLocation($src, $photos); } else { $error = $this->fromFile($src, $photos, $url); } if ($error) { return $this->error($error); } if ($numcols < 1) { $numcols = 1; } if ($align != 'left' && $align != 'center' && $align != 'right') { $align = 'center'; } if (count($photos) == 0) { return; } if (in_array("sort", $attributes)) { sort($photos); } if ($p) { $mode = "normal"; } if ($mode == "column") { $mode = "normal"; $numcols = "1"; } // set some fixed properties for each $mode if ($mode == 'thumbs' || $mode == 'tiles') { $attributes = array_merge($attributes, "alt"); $attributes = array_merge($attributes, "nowrap"); $cellwidth = 'auto'; // else cell won't nowrap $width = 50; } elseif ($mode == 'list') { $numcols = 1; $cellwidth = "auto"; $width = 50; } elseif ($mode == 'slide') { $tableheight = 0; $cell_width = 0; $numcols = count($photos); $keep = $photos; while (list($key, $value) = each($photos)) { list($x, $y, $s, $t) = @getimagesize($value['src']); if ($height != 'auto') { $y = $this->newSize($y, $height); } if ($width != 'auto') { $y = round($y * $this->newSize($x, $width) / $x); } if ($x > $cell_width) { $cell_width = $x; } if ($y > $tableheight) { $tableheight = $y; } } $tableheight += 50; $photos = $keep; unset($x, $y, $s, $t, $key, $value, $keep); } $row = HTML(); $duration = 1000 * $duration; if ($mode == 'slide') { $row->pushContent(JavaScript("\ni = 0;\nfunction display_slides() {\n j = i - 1;\n cell0 = document.getElementsByName('wikislide' + j);\n cell = document.getElementsByName('wikislide' + i);\n if (cell0.item(0) != null)\n cell0.item(0).style.display='none';\n if (cell.item(0) != null)\n cell.item(0).style.display='block';\n i += 1;\n if (cell.item(0) == null) i = 0;\n setTimeout('display_slides()',{$duration});\n}\ndisplay_slides();")); } while (list($key, $value) = each($photos)) { if ($p && basename($value["name"]) != "{$p}") { continue; } if ($h && basename($value["name"]) == "{$h}") { $color = $hlcolor ? $hlcolor : $bgcolor; } else { $color = $bgcolor; } // $params will be used for each <img > tag $params = array('src' => $value["name"], 'src_tile' => $value["name_tile"], 'border' => "0", 'alt' => ($value["desc"] != "" and in_array("alt", $attributes)) ? $value["desc"] : basename($value["name"])); if (!@empty($value['location'])) { $params = array_merge($params, array("location" => $value['location'])); } // check description switch ($showdesc) { case 'none': $value["desc"] = ''; break; case 'name': $value["desc"] = basename($value["name"]); break; case 'desc': break; default: // 'both' if (!$value["desc"]) { $value["desc"] = basename($value["name"]); } break; } // FIXME: get getimagesize to work with names with spaces in it. // convert $value["name"] from webpath to local path $size = @getimagesize($value["name"]); // try " " => "\\ " if (!$size and !empty($value["src"])) { $size = @getimagesize($value["src"]); if (!$size) { trigger_error("Unable to getimagesize(" . $value["name"] . ")", E_USER_NOTICE); } } $newwidth = $this->newSize($size[0], $width); if ($mode == 'thumbs' || $mode == 'tiles' || $mode == 'list') { if (!empty($size[0])) { $newheight = round(50 * $size[1] / $size[0]); } else { $newheight = ''; } if ($height == 'auto') { $height = 150; } } else { $newheight = $this->newSize($size[1], $height); } if ($width != 'auto' && $newwidth > 0) { $params = array_merge($params, array("width" => $newwidth)); } if ($height != 'auto' && $newheight > 0) { $params = array_merge($params, array("height" => $newheight)); } // cell operations $cell = array('align' => "center", 'valign' => "top", 'bgcolor' => "{$color}"); if ($cellwidth != 'auto') { if ($cellwidth == 'equal') { $newcellwidth = round(100 / $numcols) . "%"; } else { if ($cellwidth == 'image') { $newcellwidth = $newwidth; } else { $newcellwidth = $cellwidth; } } $cell = array_merge($cell, array("width" => $newcellwidth)); } if (in_array("nowrap", $attributes)) { $cell = array_merge($cell, array("nowrap" => "nowrap")); } //create url to display single larger version of image on page $url = WikiURL($request->getPage(), array("p" => basename($value["name"]))) . "#" . basename($value["name"]); $b_url = WikiURL($request->getPage(), array("h" => basename($value["name"]))) . "#" . basename($value["name"]); $url_text = $link ? HTML::a(array("href" => "{$url}"), basename($value["desc"])) : basename($value["name"]); if (!$p) { if ($mode == 'normal' || $mode == 'slide') { if (!@empty($params['location'])) { $params['src'] = $params['location']; } unset($params['location'], $params['src_tile']); $url_image = $link ? HTML::a(array("id" => basename($value["name"])), HTML::a(array("href" => "{$url}"), HTML::img($params))) : HTML::img($params); } else { $keep = $params; if (!@empty($params['src_tile'])) { $params['src'] = $params['src_tile']; } unset($params['location'], $params['src_tile']); $url_image = $link ? HTML::a(array("id" => basename($value["name"])), HTML::a(array("href" => "{$url}"), ImageTile::image_tile($params))) : HTML::img($params); $params = $keep; unset($keep); } } else { if (!@empty($params['location'])) { $params['src'] = $params['location']; } unset($params['location'], $params['src_tile']); $url_image = $link ? HTML::a(array("id" => basename($value["name"])), HTML::a(array("href" => "{$b_url}"), HTML::img($params))) : HTML::img($params); } if ($mode == 'list') { $url_text = HTML::a(array("id" => basename($value["name"])), $url_text); } // here we use different modes if ($mode == 'tiles') { $row->pushContent(HTML::td($cell, HTML::table(array("cellpadding" => 1, "border" => 0), HTML::tr(HTML::td(array("valign" => "top", "rowspan" => 2), $url_image), HTML::td(array("valign" => "top", "nowrap" => 0), HTML::span(array('class' => 'boldsmall'), $url_text), HTML::br(), HTML::span(array('class' => 'gensmall'), $size[0] . " x " . $size[1] . " pixels")))))); } elseif ($mode == 'list') { $desc = $showdesc != 'none' ? $value["desc"] : ''; $row->pushContent(HTML::td(array("valign" => "top", "nowrap" => 0, "bgcolor" => $color), HTML::span(array('class' => 'boldsmall'), $url_text))); $row->pushContent(HTML::td(array("valign" => "top", "nowrap" => 0, "bgcolor" => $color), HTML::span(array('class' => 'gensmall'), $size[0] . " x " . $size[1] . " pixels"))); if ($desc != '') { $row->pushContent(HTML::td(array("valign" => "top", "nowrap" => 0, "bgcolor" => $color), HTML::span(array('class' => 'gensmall'), $desc))); } } elseif ($mode == 'thumbs') { $desc = $showdesc != 'none' ? HTML::p(HTML::a(array("href" => "{$url}"), $url_text)) : ''; $row->pushContent(HTML::td($cell, $url_image, HTML::span(array('class' => 'gensmall'), $desc))); } elseif ($mode == 'normal') { $desc = $showdesc != 'none' ? HTML::p($value["desc"]) : ''; $row->pushContent(HTML::td($cell, $url_image, HTML::span(array('class' => 'gensmall'), $desc))); } elseif ($mode == 'slide') { if ($newwidth == 'auto' || !$newwidth) { $newwidth = $this->newSize($size[0], $width); } if ($newwidth == 'auto' || !$newwidth) { $newwidth = $size[0]; } if ($newheight != 'auto') { $newwidth = round($size[0] * $newheight / $size[1]); } $desc = $showdesc != 'none' ? HTML::p($value["desc"]) : ''; if ($count == 0) { $cell = array('style' => 'display: block; ' . 'position: absolute; ' . 'left: 50% ; ' . 'margin-left: -' . round($newwidth / 2) . 'px;' . 'text-align: center; ' . 'vertical-align: top', 'name' => "wikislide" . $count); } else { $cell = array('style' => 'display: none; ' . 'position: absolute ;' . 'left: 50% ;' . 'margin-left: -' . round($newwidth / 2) . 'px;' . 'text-align: center; ' . 'vertical-align: top', 'name' => "wikislide" . $count); } if ($align == 'left' || $align == 'right') { if ($count == 0) { $cell = array('style' => 'display: block; ' . 'position: absolute; ' . $align . ': 50px; ' . 'vertical-align: top', 'name' => "wikislide" . $count); } else { $cell = array('style' => 'display: none; ' . 'position: absolute; ' . $align . ': 50px; ' . 'vertical-align: top', 'name' => "wikislide" . $count); } } $row->pushContent(HTML::td($cell, $url_image, HTML::span(array('class' => 'gensmall'), $desc))); $count++; } elseif ($mode == 'row') { $desc = $showdesc != 'none' ? HTML::p($value["desc"]) : ''; $row->pushContent(HTML::table(array("style" => "display: inline"), HTML::tr(HTML::td($url_image)), HTML::tr(HTML::td(array("class" => "gensmall", "style" => "text-align: center; " . "background-color: {$color}"), $desc)))); } else { return $this->error(fmt("Invalid argument: %s=%s", 'mode', $mode)); } // no more images in one row as defined by $numcols if (($key + 1) % $numcols == 0 || $key + 1 == count($photos) || $p) { if ($mode == 'row') { $html->pushcontent(HTML::span($row)); } else { $html->pushcontent(HTML::tr($row)); } $row->setContent(''); } } //create main table $table_attributes = array("border" => 0, "cellpadding" => 5, "cellspacing" => 2, "width" => $tablewidth); if (!@empty($tableheight)) { $table_attributes = array_merge($table_attributes, array("height" => $tableheight)); } if ($mode != 'row') { $html = HTML::table($table_attributes, $html); } // align all return HTML::div(array("align" => $align), $html); }
function logo() { //logo click opens the HomePage in the main browser frame global $WikiTheme; $img = HTML::img(array('src' => $WikiTheme->getImageURL('logo'), 'border' => 0, 'align' => 'right', 'style' => 'height:2.5ex')); $linkurl = WikiLink(HOME_PAGE, false, $img); $linkurl->setAttr('target', '_content'); return $linkurl; }
use yii\helpers\Html; $year = 2016; /* @var $this yii\web\View */ $this->title = 'Dragon Con ' . $year; // $this->params['breadcrumbs'][] = $this->title; ?> <div class="site-about"> <div class="row"> <div class="col-lg-12"> <?php echo HTML::img("@web/images/300px-Dragonconlogo1.png"); ?> <span style="font-size: 72px; vertical-align: middle;"> <?php echo $year; ?> in <?php echo date("z", mktime(0, 0, 0, 9, 1, $year)) - date("z") . " Days"; ?> </span> </div> </div> <div class="row">
function renderCategory($level, $cat) { global $session; global $db; $qs = "SELECT " . "category_id, " . "category_name, " . "category_description, " . "category_created, " . "category_creator, " . "user_login, " . "user_name, " . "(SELECT COUNT(*) FROM phph_photos_categories WHERE phph_photos_categories.category_id = phph_categories.category_id) AS photos " . "FROM phph_categories " . "LEFT OUTER JOIN phph_users ON phph_categories.category_creator = phph_users.user_id "; if (!empty($cat)) { $qs .= "WHERE category_parent = {$cat} "; } else { $qs .= "WHERE category_parent IS NULL "; } $qs .= "ORDER BY category_order ASC"; $q = $db->prepare($qs); $res = $db->execute($q); if (PEAR::isError($res)) { die($res->getMessage()); } $i = 0; while ($res->fetchInto($row)) { $created = strftime("%Y-%m-%d %T", $row['category_created']); ?> <tr> <td><a href="<?php echo HTML::addRef($session->addSID("category_info.php?cid=" . $row['category_id'])); ?> "><?php echo $row['category_id']; ?> </a></td> <?php $indent = $level * 30 + 4; ?> <td style="padding-left: <?php echo $indent; ?> px;"> <a href="<?php echo HTML::addRef($session->addSID("category_info.php?cid=" . $row['category_id'])); ?> "><?php echo htmlspecialchars($row['category_name']); ?> </a><div class="a_table_list_details"><?php echo nl2br(htmlspecialchars($row['category_description'])); ?> </div></td> <td><?php echo $created; ?> </td> <td> <?php if ($row['category_creator'] > 0) { ?> <a href="<?php echo HTML::addRef($session->addSID("user_info.php?uid=" . $row['category_creator'])); ?> "><?php echo htmlspecialchars($row['user_login']); ?> </a><div class="a_table_list_details"><?php echo htmlspecialchars($row['user_name']); ?> </div> <?php } else { ?> - <?php } ?> </td> <td><?php echo $row['photos']; ?> </td> <td class="a_icon"> <?php if ($i > 0) { ?> <a href="<?php echo HTML::addRef($session->addSID("cat_up.php?cid=" . $row['category_id'] . "&pcid=" . $cat)); ?> " title="Przenie¶ wy¿ej"><?php HTML::img("up.gif", "Przenie¶ wy¿ej"); ?> </a> <?php } ?> </td> <td class="a_icon"> <?php if ($i < $res->numRows() - 1) { ?> <a href="<?php echo HTML::addRef($session->addSID("cat_down.php?cid=" . $row['category_id'] . "&pcid=" . $cat)); ?> " title="Przenie¶ ni¿ej"><?php HTML::img("down.gif", "Przenie¶ ni¿ej"); ?> </a> <?php } ?> </td> <td class="a_icon"> <a href="<?php echo HTML::addRef($session->addSID("edit_category.php?action=edit&cid=" . $row['category_id'])); ?> " title="<?php echo _ADMIN_EDIT_CATEGORY; ?> "><?php HTML::img("edit.gif", _ADMIN_EDIT_CATEGORY); ?> </a> </td> <td class="a_icon"> <a href="<?php echo HTML::addRef($session->addSID("remove_category.php?cid=" . $row['category_id'])); ?> " title="<?php echo _ADMIN_REMOVE_CATEGORY; ?> " onclick='return confirm("<?php echo sprintf(_ADMIN_CONFIRM_DELETE_CATEGORY, $row['category_name']); ?> ");'><?php HTML::img("trash.gif", _ADMIN_REMOVE_CATEGORY); ?> </a> </td> <td class="a_icon"> <a href="<?php echo HTML::addRef($session->addSID("photos.php?cid=" . $row['category_id'])); ?> " title="<?php echo _ADMIN_PHOTOS; ?> "><?php HTML::img("photo.gif", _ADMIN_PHOTOS); ?> </a> </td> </tr> <?php $this->renderCategory($level + 1, $row['category_id']); $i++; } }
/** Constructor * * @param $text string The text for the button. * @param $url string The url (href) for the button. * @param $class string The CSS class for the button. * @param $img_url string URL for button's image. * @param $img_attr array Additional attributes for the <img> tag. */ function ImageButton($text, $url, $class, $img_url, $img_attr = false) { $this->__construct('a', array('href' => $url)); if ($class) { $this->setAttr('class', $class); } // Google honors this if (in_array(strtolower($text), array('edit', 'create', 'diff', 'pdf')) and !$GLOBALS['request']->_user->isAuthenticated()) { $this->setAttr('rel', 'nofollow'); } if (!is_array($img_attr)) { $img_attr = array(); } $img_attr['src'] = $img_url; $img_attr['alt'] = $text; $img_attr['class'] = 'wiki-button'; $img_attr['border'] = 0; $this->pushContent(HTML::img($img_attr)); }
function run($dbi, $argstr, &$request, $basepage) { $args = $this->getArgs($argstr, $request); if (empty($args['url'])) { return ''; } extract($args); $posted = $GLOBALS['HTTP_POST_VARS']; if (in_array('url', array_keys($posted))) { $s = $posted['s']; $this->_url = $posted['url']; $this->_getInterWikiUrl($request); if (strstr($this->_url, '%s')) { $this->_url = sprintf($this->_url, $s); } else { $this->_url .= $s; } if (defined('DEBUG') && DEBUG && $debug) { trigger_error("redirect url: " . $this->_url); } else { $request->redirect($this->_url); //no return! } } $this->_name = $name; $this->_s = $s; if ($formsize < 1) { $formsize = 30; } $this->_url = $url; $this->_getInterWikiUrl($request); $form = HTML::form(array('action' => $request->getPostURL(), 'method' => 'post', 'accept-charset' => $GLOBALS['charset']), HiddenInputs(array('pagename' => $basepage))); $form->pushContent(HTML::input(array('type' => 'hidden', 'name' => 'url', 'value' => $this->_url))); $s = HTML::input(array('type' => 'text', 'value' => $this->_s, 'name' => 's', 'size' => $formsize)); if (!empty($args["useimage"])) { //FIXME: This does not work with Gecko $button = HTML::img(array('src' => $useimage, 'alt' => 'imagebutton')); if (!empty($width)) { $button->setAttr('width', $width); } if (!empty($height)) { $button->setAttr('height', $height); } // on button_position => none display no input form if ($button_position == 'right') { $form->pushContent($s); } $form->pushContent(HTML::button(array('type' => 'button', 'class' => 'button', 'value' => $this->_name), $button)); if ($button_position == 'left') { $form->pushContent($s); } } else { if ($button_position != 'left' and $button_position != 'right') { return $this->error(fmt("Invalid argument: %s=%s", 'button_position', $button_position)); } $button = HTML::input(array('type' => 'submit', 'class' => 'button', 'value' => $this->_name)); if ($button_position == 'left') { $form->pushContent($button); $form->pushContent($s); } elseif ($button_position == 'right') { $form->pushContent($s); $form->pushContent($button); } } return $form; }
echo HTML::img('/uploads/demo/slideshow/1.jpg', ['class' => 'img-responsive']); ?> <?php echo HTML::img('/uploads/demo/slideshow/2.jpg', ['class' => 'img-responsive']); ?> <?php echo HTML::img('/uploads/demo/slideshow/3.jpg', ['class' => 'img-responsive']); ?> <?php echo HTML::img('/uploads/demo/slideshow/4.jpg', ['class' => 'img-responsive']); ?> <?php echo HTML::img('/uploads/demo/slideshow/5.jpg', ['class' => 'img-responsive']); ?> <?php echo HTML::img('/uploads/demo/slideshow/6.jpg', ['class' => 'img-responsive']); ?> </div> </div> <hr /> <div class="site-index-products"> <ul class="nav nav-tabs" role="tablist"> <li role="presentation" class="active"><a href="#oto-con" aria-controls="oto-con" role="tab" data-toggle="tab">Phụ tùng ô tô con</a></li> <li role="presentation"><a href="#oto-con-tsk-tbk" aria-controls="oto-con-tsk-tbk" role="tab" data-toggle="tab">Hãng TSK, TBK</a></li> <li role="presentation"><a href="#oto-con-miyaco" aria-controls="oto-con-miyaco" role="tab" data-toggle="tab">Hãng MIYACO</a></li> <li role="presentation"><a href="#oto-con-ctr" aria-controls="oto-con-ctr" role="tab" data-toggle="tab">Hãng CTR</a></li> </ul> <div class="panel panel-body"> <div class="row tab-content"> <!-- Oto con -->