public function render($doctype, $environment) { $languages = ipContent()->getLanguages(); $answer = ''; foreach ($languages as $language) { $langValue = ''; $fieldValue = $this->getValue(); if (is_array($fieldValue)) { if (!empty($fieldValue[$language->getCode()])) { $langValue = $fieldValue[$language->getCode()]; } } if (!is_string($langValue)) { //just in case we have an array or something else incompatible with below code in the database $langValue = ''; } $answer .= ' <div class="input-group"> <span class="input-group-addon">' . esc($language->getAbbreviation()) . '</span> <input ' . $this->getAttributesStr($doctype) . ' class="form-control ' . implode(' ', $this->getClasses()) . '" name="' . escAttr($this->getName() . '[' . $language->getCode() . ']" ') . $this->getValidationAttributesStr($doctype) . ' type="text" value="' . escAttr($langValue) . '" /> </div> '; } return $answer; }
public function render($doctype, $environment) { $input = '<input ' . $this->getAttributesStr($doctype) . ' class="form-control ' . implode(' ', $this->getClasses()) . '" name="' . escAttr($this->getName()) . '" ' . $this->getValidationAttributesStr($doctype) . ' type="text" value="' . escAttr($this->getValue()) . '" />'; $buttons = '<div class="input-group-btn"> <button type="button" class="btn btn-default ipsSelectSourceFile"><i class="fa fa-file-o"> </i></button> <button type="button" class="btn btn-default ipsRemoveSourceFile"><i class="fa fa-trash-o"> </i></button> </div>'; return '<div class="input-group">' . $input . $buttons . '</div>'; }
function img($varname, $default, $width, $height, $class = '', $tagname = 'img') { $varname = $this->num != -1 ? $varname . '-' . $this->num : $varname; $defaultval = ipThemeUrl('assets/') . $default; if (array_key_exists($varname, $this->data)) { $fileName = $this->data[$varname]['fileName']; $transform = array('type' => 'crop', 'x1' => $this->data[$varname]['crop']['x1'], 'y1' => $this->data[$varname]['crop']['y1'], 'x2' => $this->data[$varname]['crop']['x2'], 'y2' => $this->data[$varname]['crop']['y2'], 'width' => $width, 'height' => $height); $url = ipFileUrl(ipReflection($fileName, $transform, $fileName)); $imgdata = escAttr(json_encode($this->data[$varname])); } else { $url = $defaultval; $imgdata = ""; } return "<{$tagname} class=\"ipsEditable {$class}\" data-type=\"Image\" data-varname=\"{$varname}\"\n\t\t\t\t\tdata-cssclass=\"{$class}\" data-image=\"{$imgdata}\" src=\"{$url}\"/>"; }
<div class="slick"> <?php foreach ($images as $imageKey => $image) { ?> <div> <img data-lazy="<?php echo escAttr($image['imageBig']); ?> " alt="<?php echo escAttr($image['title']); ?> " /> <?php echo isset($image['description']) ? '<div>' . escAttr($image['description']) . '</div>' : ''; ?> </div> <?php } ?> </div>
/** * Get field attributes as HTML string * * @param $doctype \Ip\View doctype constant * @return string */ public function getAttributesStr($doctype) { $answer = ''; foreach ($this->getAttributes() as $attributeKey => $attributeValue) { $answer .= ' ' . htmlspecialchars($attributeKey) . '="' . escAttr($attributeValue) . '"'; } return $answer; }
<?php echo $image['nofollow'] ? ' rel="nofollow" ' : ''; ?> <?php } ?> class="_link" title="<?php echo esc($image['title']); ?> " data-description="<?php echo isset($image['description']) ? escAttr($image['description']) : ''; ?> " > <img class="_image ipsImage" src="<?php echo escAttr($image['imageSmall']); ?> " alt="<?php echo escAttr($image['title']); ?> " /> </a> </div> <?php } ?> </div> <?php }
if (!empty($description)) { ?> <meta property="og:description" content="<?php echo escAttr($description); ?> " /> <?php } if (!empty($siteName)) { ?> <meta property="og:site_name" content="<?php echo escAttr($siteName); ?> " /> <?php } if (!empty($images)) { ?> <?php foreach ($images as $imageUrl) { ?> <meta property="og:image" content="<?php echo escAttr($imageUrl); ?> ?v=0<?php echo \Ip\ServiceLocator::storage()->get('Ip', 'cacheVersion', 1); ?> " /> <?php } }
><a href="#" class="ipsAction" data-method="page" data-params="<?php echo esc(json_encode(array('page' => $page['page']))); ?> "><?php echo esc(isset($page['text']) ? $page['text'] : $page['page']); ?> </a></li> <?php } ?> <?php } ?> <?php if ($currentPage < $totalPages) { ?> <li><a href="#" class="ipsAction" data-method="page" data-params="<?php echo escAttr(json_encode(array('page' => $currentPage + 1))); ?> ">»</a></li> <?php } else { ?> <li class="disabled"><a href="#">»</a></li> <?php } ?> </ul> <?php }
break; case 'warning': $typeLabel = __('Warning', 'Install'); $class = 'warning'; break; case 'error': $typeLabel = __('Error', 'Install'); $class = 'danger'; break; } ?> <tr><th><?php echo $row['name'] . (!empty($row['helpUrl']) ? ' <a href="' . $row['helpUrl'] . '" target="_blank">(?)</a>' : ''); ?> </th><td class="text-center <?php echo escAttr($class); ?> "><?php echo esc($typeLabel); ?> </td></tr> <?php } ?> </table> <p class="text-right"> <?php if ($showNextStep) { ?> <a class="btn btn-primary ipsAutoForward" href="?step=3"><?php _e('Next', 'Install');
<?php /** * This is an HTML of widget management pupup. Please look at AdminController.php to see how $form variable is created. * Feel free to modify this file, but leave intact ID attributes and classes with 'ips' prefix. * */ ?> <div class="ip ipPluginSlideShowPopup" id="ipSlideShowPopup"> <div class="modal fade ipsModal"> <div class="modal-dialog"> <div class="modal-content"> <iframe frameBorder="0" border="0" hspace="0" vspace="0" marginwidth="0" marginheight="0" src="<?php echo escAttr($gridUrl); ?> "></iframe> <div class="modal-footer"> <button type="button" class="btn btn-primary" data-dismiss="modal"><?php _e('Ok', 'SlideShow'); ?> </button> </div> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> </div> </div> </div> </div> </div>
<iframe src="<?php echo escAttr($repositoryUrl); ?> " frameborder="0" style="overflow:hidden;height:100%;width:100%" height="100%" width="100%" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;height:100%;width:100%;position:absolute;top:0px;left:0px;right:0px;bottom:0px"> </iframe>
/** * HTML to be displayed in payment selection window. All this HTML will be surrounded by A tag to be clickable. * @return string */ public function html() { return '<img src="' . escAttr($this->icon()) . '" alt="' . escAttr($this->name()) . '" />'; }
echo $nofollow ? ' rel="nofollow" ' : ''; ?> <?php } ?> title="<?php echo isset($title) ? escAttr($title) : ''; ?> " data-description="<?php echo isset($description) ? escAttr($description) : ''; ?> " > <img class="ipsImage" src="<?php echo escAttr($imageSmall); ?> " alt="<?php echo isset($title) ? escAttr($title) : ''; ?> " title="<?php echo isset($title) ? escAttr($title) : ''; ?> " /> </a> <?php } else { ?> <div class="ipsImage"> </div> <?php }
<?php if (!empty($breadcrumb) && is_array($breadcrumb)) { ?> <ol class="breadcrumb"> <?php foreach ($breadcrumb as $key => $crumb) { ?> <li><a href="<?php echo escAttr($crumb['url']); ?> "><?php echo esc($crumb['title']); ?> </a></li> <?php } ?> </ol> <?php } ?> <h1><?php echo esc($title); ?> </h1>
<?php if (isset($markerlat)) { ?> data-markerlat="<?php echo escAttr($markerlat); ?> " <?php } ?> <?php if (isset($markerlng)) { ?> data-markerlng="<?php echo escAttr($markerlng); ?> " <?php } ?> style="height: <?php echo $height; ?> ;" data-initialized="0" class="ipsMap"> </div> <?php if (ipIsManagementState()) {
?> </h4> </div> <div class="modal-body ipsBody"> <?php if (count($createForm->getFieldsets()) > 1) { ?> <ul class="nav nav-tabs" role="tablist"> <?php foreach ($createForm->getFieldsets() as $key => $fieldset) { ?> <li class="<?php echo $key == 0 ? 'active' : ''; ?> "><a href="#<?php echo escAttr($fieldset->getAttribute('id')); ?> " role="tab" data-toggle="tab"><?php echo esc($fieldset->getLabel()); ?> </a></li> <?php $fieldset->setLabel(' '); ?> <?php } ?> </ul> <?php } ?>
public static function ipHead($head, $info) { $relativePath = ipRequest()->getRelativePath(); $canonicalUrl = null; //detect if we need to add canonical meta tag because we are on the home page if (ipContent()->getCurrentPage() && ipContent()->getCurrentPage()->getId() == ipContent()->getDefaultPageId() && ipRequest()->getRelativePath() != '') { //if current page is the default page of current language and relative path is not empty $languages = ipContent()->getLanguages(); $firstLanguage = $languages[0]; if (ipContent()->getCurrentLanguage()->getId() == $firstLanguage->getId()) { //if current language is the first language, set canonical to the base URL. $canonicalUrl = ipConfig()->baseUrl(); } elseif (ipRequest()->getRoutePath() != '') { //if current URL is not equal to the language URL, set canonical as language URL $canonicalUrl = ipContent()->getcurrentLanguage()->getLink(); } } //detect if we need to add canonical tag because of missing trailing slash if (!$canonicalUrl) { //if canonicalUrl is not set yet if (ipGetOption('Config.trailingSlash', 1) && ipContent()->getCurrentPage()) { if (substr($relativePath, -1) != '/') { $canonicalUrl = ipConfig()->baseUrl() . $relativePath . '/'; } } else { if (substr($relativePath, -1) == '/') { $canonicalUrl = ipConfig()->baseUrl() . substr($relativePath, 0, -1); } } } if ($canonicalUrl) { $append = ' <link rel="canonical" href="' . escAttr($canonicalUrl) . '" />' . "\n"; $head .= $append; } return $head; }
"><?php _e('Home', 'Ip'); ?> </a></li> <?php } foreach ($pages as $key => $page) { ?> <?php if ($key < count($pages) - 1) { ?> <li><a href="<?php echo escAttr($page->getLink()); ?> " title="<?php echo escAttr($page->getTitle()); ?> "><?php echo esc($page->getTitle()); ?> </a></li> <?php } else { ?> <li class="active"><?php echo esc($page->getTitle()); ?> </li> <?php } }
?> <div class="_file ipsFile"> <button type="button" class="close ipsRemove">×</button> <div><a target="_blank" class="ipsLink ipsFileName" href="<?php echo ipFileUrl('file/repository/' . $file); ?> "><?php echo esc($file); ?> </a></div> <input type="hidden" name="<?php echo escAttr($inputName); ?> []" value="<?php echo escAttr($file); ?> "/> </div> <?php } ?> <?php } ?> </div> <div class="well _file ipsFile ipsFileTemplate hidden"> <button type="button" class="close ipsRemove" aria-hidden="true">×</button> <div><a target="_blank" class="ipsLink ipsFileName" href=""></a></div> <input type="hidden" name="" value=""/> </div>
/** @var $language \Ip\Language */ ?> <?php if (!$language->isVisible()) { continue; } ?> <?php $activeClass = $language->isCurrent() ? ' class="active"' : ''; ?> <li <?php echo $activeClass; ?> > <a title="<?php echo escAttr($language->getTitle()); ?> " href="<?php echo escAttr($language->getLink()); ?> "> <?php echo esc($language->getAbbreviation()); ?> </a> </li> <?php } ?> </ul>
protected function generateLessVariables($options, $config) { $less = ''; foreach ($options as $option) { if (isset($option['addToLess']) && !$option['addToLess']) { continue; } if (empty($option['name']) || empty($option['type'])) { continue; // ignore invalid nodes } if (isset($config[$option['name']])) { $rawValue = $config[$option['name']]; } elseif (isset($option['default'])) { $rawValue = $option['default']; } else { $rawValue = ''; //continue; } switch ($option['type']) { case 'select': case 'Select': case 'color': case 'Color': $lessValue = $rawValue; break; case 'RepositoryFile': $lessValue = $rawValue; $lessValue = "'" . ipFileUrl('file/repository/' . escAttr($lessValue)) . "'"; break; default: case 'hidden': case 'Hidden': case 'range': case 'Range': $lessValue = $rawValue; if (!empty($option['units'])) { $lessValue .= $option['units']; } if (!isset($option['escape']) || $option['escape']) { $lessValue = "'" . preg_replace('~[\\r\\n]+~', '\\r\\n', escAttr($lessValue)) . "'"; } break; } $less .= "\n@{$option['name']}: {$lessValue};"; } return $less; }
<div class="page-header"> <?php if (!empty($icon)) { ?> <img class="_icon" src="<?php echo escAttr($icon); ?> " alt="Plugin icon" /> <?php } ?> <h1><?php echo esc($plugin['title']); ?> </h1> </div> <div class="_actions clearfix"> <?php if ($plugin['active']) { ?> <button class="ipsDeactivate btn btn-default" type="button" role="button"><?php _e('Deactivate', 'Ip-admin'); ?> </button> <?php } else { ?> <button class="ipsDelete btn btn-danger pull-right" type="button" role="button"><?php _e('Delete', 'Ip-admin'); ?>
$submenu = ipView($view, $submenuData)->render(); } if (!empty($css)) { $class = ' class="' . implode(' ', $css) . '"'; } ?> <li<?php echo $class; ?> > <a<?php echo $href; echo $target; ?> title="<?php echo escAttr($menuItem->getPageTitle()); ?> "> <?php echo esc($menuItem->getTitle()); ?> </a> <?php echo $submenu; ?> </li><?php } ?> </ul> <?php }
?> var <?php echo $name; ?> = <?php echo json_encode($variable); ?> ; <?php } ?> </script> <?php foreach ($javascript as $recordKey => $record) { if ($record['type'] == 'file') { echo ' <script type="text/javascript" src="' . escAttr($record['value']) . '"'; if (is_array($record['attributes'])) { echo join(' ', array_map(function ($sKey, $sValue) { return esc($sKey) . '="' . esc($sValue) . '"'; }, array_keys($record['attributes']), array_values($record['attributes']))); } echo '></script>' . "\n"; } if ($record['type'] == 'variable') { echo ' <script type="text/javascript"> var ' . $recordKey . ' = ' . json_encode($record['value']) . '; </script>' . "\n"; } if ($record['type'] == 'content') { echo ' <script type="text/javascript"> ' . $record['value'] . '
echo $class; ?> > <a <?php echo strlen($anchorToggleClass) > 0 ? 'data-toggle="dropdown" ' : ''; ?> class="<?php echo $anchorToggleClass; ?> " <?php echo $href; echo $target; ?> title="<?php echo escAttr($menuItem->getTitle()); ?> "> <?php echo $menuItem->getTitle(); ?> </a> <?php echo $submenu; ?> </li><?php } ?> </ul> <?php }
?> class="_link" title="<?php echo esc($image['title']); ?> " data-description="<?php echo isset($image['description']) ? escAttr($image['description']) : ''; ?> " > <img width="100%" class="_image ipsImage" src="<?php echo escAttr($image['imageBig']); ?> " title="<?php echo escAttr($image['title']); ?> " data-description="<?php echo isset($image['description']) ? escAttr($image['description']) : ''; ?> " /> </a> </div> <?php } ?> </div> <?php } ?> </div>
// single quotes around because json encodes with double quotes ?> " data-cssclass="<?php echo escAttr($cssClass); ?> " class="ipsModuleInlineManagementImage ipModuleInlineManagement<?php echo $empty ? ' _empty' : ''; ?> <?php echo escAttr($cssClass); ?> " src="<?php echo $empty ? escAttr($defaultValue) : escAttr($value); ?> " alt="" style="<?php if (!empty($options['height'])) { echo 'height: ' . (int) $options['height'] . 'px;'; } if (!empty($options['width'])) { echo 'width: ' . (int) $options['width'] . 'px;'; } ?> " /> <?php }
<div class="btn-group <?php echo $position == 'top' ? 'dropdown' : 'dropup'; ?> "> <div class="dropdown _pageSize ipsPageSize"> Items per page <button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown" aria-expanded="true"> <?php echo (int) $pageSize; ?> <span class="caret"></span> </button> <ul class="dropdown-menu" role="menu"> <?php foreach ($pageSizes as $size) { ?> <li role="presentation"><a class="ipsPageSizeSetting" data-rows="<?php echo escAttr($size); ?> " role="menuitem" tabindex="-1" href="#"><?php echo esc($size); ?> </a></li> <?php } ?> </ul> </div> </div>
<h<?php echo (int) $level; ?> class="_title"<?php echo isset($anchor) ? ' id="' . esc($anchor) . '" data-magellan-destination="' . $anchor . '"' : ''; ?> > <?php if ($showLink) { ?> <a href="<?php echo escAttr($link); ?> "<?php echo !empty($blank) ? ' target="_blank"' : ''; ?> > <?php } ?> <?php echo !empty($title) ? $title : ' '; ?> <?php if ($showLink) { ?> </a> <?php } ?> </h<?php
<?php /** @var $paymentMethods \Ip\Payment[] */ echo ipRenderWidget('Heading', array('title' => __('Choose a payment method', 'Ip', false))); ?> <div class="ipEcommerce"> <?php echo ipRenderWidget('Divider', array(), 'space'); foreach ($paymentMethods as $paymentMethod) { ?> <?php echo ipRenderWidget('Text', array('text' => '<div class="_paymentMethod _paymentMethod_' . escAttr($paymentMethod->name()) . '"><a href="#" class="ipsPaymentMethod" data-name="' . escAttr($paymentMethod->name()) . '">' . $paymentMethod->html() . '</a></div>')); } ?> </div>