public function _render($options) { if ($this->getParam('layout') === 'vCard') { $this->_renderVCardLayout($options); } else { $columns = $this->postColumns; $rowSpan = 12 / $columns; $foundPosts = count($this->posts); $rowClass = array('row-fluid'); if ($this->shouldPaginate) { $rowClass[] = 'slides-container'; } ?> <div class="<?php echo implode(' ', $rowClass); ?> "> <?php $counter = 1; while (have_posts()) { the_post(); global $post; View::renderElement('layout-components-parts/single/staff', array('rowSpan' => $rowSpan, 'columns' => $columns, 'counter' => $counter, 'shouldPaginate' => $this->shouldPaginate, 'post' => $post, 'excerptLength' => $this->getParam('excerptLength'), 'socialNetworksDisplay' => Set::booleanize($this->getParam('socialNetworksDisplay')))); if ($counter % $columns === 0 && $counter < $foundPosts && $this->getParam('layout') === 'grid') { echo '</div><div class="row-fluid">'; } $counter++; } ?> </div> <?php } }
protected function _render($options) { $networks = Set::filter(Set::booleanize($this->getParam('socialNetworks'))); echo '<div class="bluebox-share-options">'; echo '<span>' . __('Share The Story', 'gummfw') . '</span>'; echo '<div class="bluebox-details-social">'; View::renderElement('social-links', array('networks' => $networks, 'accountMode' => 'share', 'additionalClass' => 'bluebox-shadows')); echo '</div>'; echo '</div>'; }
protected function _render($options) { global $post; $mediaDimensions = array(); if ($this->getParam('mediaCrop') === 'crop') { $rowSpan = 12 * $this->widthRatio(); $mediaDimensions = array('ar' => $this->getParam('aspectRatio'), 'context' => 'span' . $rowSpan); } if ($post->Thumbnail) { if (count($post->Media) > 1) { $sliderType = $this->getParam('sliderType'); $settings = array_merge($this->getDefaultSettingsForSlider($sliderType), array('elementId' => $this->id(), 'media' => $post->Media, 'dimensions' => $mediaDimensions, 'linkToParent' => false)); switch ($sliderType) { case 'flex': View::renderElement('layout-components-parts/sliders/flex-slider', $settings); break; case 'windy': View::renderElement('layout-components-parts/sliders/windy-slider', $settings); break; case 'ios': View::renderElement('layout-components-parts/sliders/ios-slider', $settings); break; } } elseif ($post->PostMeta['featured_image_single_display']) { ?> <?php $imageDetailsAtts = array('class' => 'image-details', 'style' => 'display:inline;'); $prettyPhotoLink = ''; $thePostMediaGuid = ''; if ($post->Media) { $thePostMediaGuid = $post->Media[0]->guid; } else { $thePostMediaGuid = $post->Thumbnail->guid; } if ($this->getParam('prettyPhotoSingleLink') === 'true') { $imageDetailsAtts['style'] = ''; $prettyPhotoLink = '<a href="' . $thePostMediaGuid . '" class="image-details-link image-wrap-mask" rel="prettyPhoto[featured-image-for-' . $post->ID . ']"><i class="icon-search"></i></a>'; } ?> <div class="image-wrap"> <span<?php $this->Html->_constructTagAttributes($imageDetailsAtts); ?> > <?php echo $this->Media->display($thePostMediaGuid, $mediaDimensions, array('alt' => get_the_title())); echo $prettyPhotoLink; ?> </span> </div> <?php } } }
/** * @return void */ public function render($fields) { $networks = Set::filter(Set::booleanize($this->getParam('socialNetworks'))); $mode = $this->getParam('mode'); // echo '<div class="bluebox-share-options">'; // echo '<span>' . __('Share The Story') . '</span>'; echo '<div class="bluebox-details-social">'; View::renderElement('social-links', array('networks' => $networks, 'accountMode' => $mode, 'additionalClass' => 'social-link bluebox-shadows')); echo '</div>'; // echo '</div>'; }
/** * @return void */ public function render($fields) { $elementId = uniqid(); echo '<div class="blog-1-col">'; while (have_posts()) { the_post(); global $post; View::renderElement('layout-components-parts/post/single-vertical-item', array('post' => $post, 'displayMetaInfo' => $fields['metaFieldsDisplay'] === 'true', 'elementId' => $elementId, 'lightBoxLinkDisplay' => $fields['lightBoxLinkDisplay'] === 'true')); } echo '</div>'; }
protected function _render($options) { $rowSpan = 12 * $this->widthRatio(); $mediaDimensions = array('ar' => $this->getParam('aspectRatio'), 'context' => 'span' . $rowSpan); $linkToParent = $this->getParam('mediaSource') === 'post'; $sliderType = $this->getParam('sliderType'); $settings = array_merge($this->getDefaultSettingsForSlider($sliderType), array('elementId' => $this->id(), 'media' => $this->media, 'dimensions' => $mediaDimensions, 'linkToParent' => $linkToParent)); switch ($sliderType) { case 'flex': View::renderElement('layout-components-parts/sliders/flex-slider', $settings); break; case 'windy': View::renderElement('layout-components-parts/sliders/windy-slider', $settings); break; case 'ios': View::renderElement('layout-components-parts/sliders/ios-slider', $settings); break; } }
function getlayoutMarkup($layoutMarkup, $layoutTokens, $dataModuleResult, $Content, $matches, $topic) { $ModuleView = new View($this->Controller); $ModuleView->layout = $this->layout; if (sizeof($layoutTokens['specific']) > 0) { $jsUpdateModuleVal = ""; for ($i = 0; $i < sizeof($layoutTokens['specific']); ++$i) { $moduleName = $layoutTokens['specific'][$i]['moduleName']; //Accessing Modules name $moduleSize = $layoutTokens['specific'][$i]['size']; //Accessing Modules size $moduleContent = $Content["specific"][$i]; //Accessing Modules content $moduleUpdateInSeconds = $dataModuleResult["specific"][$i]['Module']['updateInSeconds']; //Accessing Modules Update in Seconds. //If Module is youtube, We need to get the first video ID to display it on the player and get related videos. //js string with every Modules name and their corresponding Update in seconds value to be used on js timer (refresher). if ($moduleName != 'youtube') { $jsUpdateModuleVal .= "CPB.modules.setUpdateInSeconds('{$moduleName}', '{$moduleUpdateInSeconds}');"; } //Getting the Token name of every module $moduleTokenName = $matches[0][$i]; //Accessing every module view and Delivering named as Module name vars in plural with their corresponing values (array). //echo "<pre>"; print_r($moduleContent); echo "</pre>"; if (sizeof($moduleContent) > 0) { $ModuleView->set("{$moduleName}s", $moduleContent); //pass topic App::import("Model", "Topic"); $Topic = new Topic(); $ModuleView->set('topic', $Topic->getTopicAbbr($topic)); //Saving every rendered Module $moduleSize = $moduleSize == "mobile" ? "mobile" : "modules"; $showModule = $ModuleView->renderElement("../" . $moduleSize . "/" . $moduleName . "/" . $moduleName); //Replacing every Module Token name with their corresponding Module Content //Only condition for jobs module is needed.... //$showModule = $moduleName == "jobs"?"<div class='Section' id='Jobs'>{$showModule}</div>":"<div id='{$moduleName}_module'>{$showModule}</div>"; $layoutMarkup = str_replace($moduleTokenName, $showModule, $layoutMarkup); } else { $layoutMarkup = str_replace($moduleTokenName, "", $layoutMarkup); } } $layoutMarkup = str_replace("*#*jsUpdateModuleString*#*", $jsUpdateModuleVal, $layoutMarkup); } return $layoutMarkup; }
/** * @return void */ protected function renderTitle() { if (!$this->supports('title')) { return; } // if ($this->getParam('enableHeading') !== 'true') return; $elementParams = array('elementId' => $this->id(), 'title' => $this->getParam('headingText'), 'paginate' => $this->shouldPaginate); View::renderElement('layout-components-parts/heading', $elementParams); }
protected function _render($options) { View::renderElement('social-links', array('networks' => $this->getParam('networks'))); }
<div class="bluebox-head-bottom"> <?php if ($headerLayout !== 'two') { ?> <div class="bluebox-prime-nav bluebox-container"> <?php $gummHtmlHelper->displayMenu(array('class' => 'prime-nav')); ?> </div> <?php } ?> </div> <?php View::renderElement('header/page-heading'); ?> </div> </div> <!-- END header --> <?php $headerElements = is_page() ? $GummTemplateBuilder->getTemplateElementsEnabled('header') : null; if ($headerElements) { foreach ($headerElements as $headerElement) { echo '<div class="row-fluid">'; $headerElement->render(); echo '</div>'; } } ?>
public function renderVerticalSingleLayout() { echo '<div class="blog-1-col">'; while (have_posts()) { the_post(); global $post; View::renderElement('layout-components-parts/post/single-vertical-item', array('lightBoxLinkDisplay' => $this->getParam('lightBoxLinkDisplay') === 'true', 'elementId' => $this->id())); } echo '</div>'; }
private function getTabPostHtml($tab, $options) { $postType = $tab['post_type']['post_type']; $args = array('post_type' => $postType, 'posts_per_page' => $tab['post_type']['posts_number']); if (isset($tab['post_type'][$postType . '-category'])) { $this->setParam($postType . '-category', $tab['post_type'][$postType . '-category']); } $this->queryPosts($args, $tab['post_type']); echo '<div class="blog-1-col">'; while (have_posts()) { the_post(); global $post; View::renderElement('layout-components-parts/post/single-vertical-item', array('elementId' => $this->id() . '_' . $post->post_type)); } echo '</div>'; wp_reset_query(); }
/** * @param array $option * @param array $attributes * @return string */ public function mediaManager(array $option, array $attributes, array $settings) { $settings = array_merge(array('buttons' => array('media', 'embed')), $settings); $outputHtml = ''; $uploadedMedia = ''; $optionId = $this->model . '.' . $option['id']; if (is_array($this->value)) { foreach ($this->value as $attachmentId) { if (is_numeric($attachmentId)) { $attachmentPost = get_post($attachmentId); if (!$attachmentPost) { continue; } $uploadedMedia .= View::renderElement('media/admin_add', array('optionId' => $optionId, 'model' => $this->model, 'attachmentPost' => $attachmentPost), false); } } } $outputHtml .= $this->Media->mediaManager(array('name' => $option['id'], 'content' => $uploadedMedia, 'optionId' => $optionId, 'buttons' => $settings['buttons'])); $outputHtml .= '<input type="hidden" name="_mergeonsave" value="0" />'; return $outputHtml; }
} ?> <!-- END footer content --> </div> </div> </div> <!-- END footer --> </div> <!-- END bluebox container --> <?php if (Configure::read('build') !== 'release') { View::renderElement('front-end-preview-panel'); } ?> <?php echo $gummWpHelper->getOption('google_analytics'); ?> <?php wp_footer(); ?> </body> </html>
public function _renderEventsListall($events) { $args = array('post_type' => 'event', 'numberposts' => '-1', 'meta_key' => GUMM_THEME_PREFIX . '_event_start_time', 'orderby' => GUMM_THEME_PREFIX . '_event_start_time', 'order' => 'ASC', 'meta_query' => array(array('key' => GUMM_THEME_PREFIX . '_event_start_time', 'value' => date_i18n('Y/m/d H:i'), 'compare' => '>='))); if ($eventCatIds = $this->getEventCategories()) { $args['tax_query'] = array(array('taxonomy' => 'event_category', 'field' => 'term_id', 'terms' => (array) $eventCatIds)); } query_posts($args); while (have_posts()) { the_post(); global $post; $divAtts = array('class' => array('bluebox-events-list')); if (!$post->Thumbnail) { $divAtts['class'][] = 'no-image'; } ?> <div<?php echo $this->Html->_constructTagAttributes($divAtts); ?> > <div class="event-date-line"> <div class="date-details-wrap"> <?php $eventStartDate = $this->Wp->getPostMeta($post->ID, 'event_start_time'); if (isset($_GET['rd'])) { $date = date_i18n('\\<\\s\\t\\r\\o\\n\\g\\>j\\<\\/\\s\\t\\r\\o\\n\\g\\>\\<\\s\\p\\a\\n\\>M\\<\\/\\s\\p\\a\\n\\>', strtotime($_GET['rd'])); } elseif ($eventStartDate) { $eventStartDate = preg_replace("'[a-z]'i", '', $eventStartDate); $date = date_i18n('\\<\\s\\t\\r\\o\\n\\g\\>j\\<\\/\\s\\t\\r\\o\\n\\g\\>\\<\\s\\p\\a\\n\\>M\\<\\/\\s\\p\\a\\n\\>', strtotime($eventStartDate)); } else { $date = date_i18n('\\<\\s\\t\\r\\o\\n\\g\\>j\\<\\/\\s\\t\\r\\o\\n\\g\\>\\<\\s\\p\\a\\n\\>M\\<\\/\\s\\p\\a\\n\\>', strtotime($post->post_date)); } echo $date; ?> </div> </div> <div class="event-details"> <div class="event-content-wrap"> <div class="image-wrap"> <div class="image-details"> <?php if ($post->Thumbnail) { echo '<a href="' . get_permalink() . '" class="image-details">'; echo $this->Media->display($post->Thumbnail->guid, array('ar' => 1, 'context' => 'span4'), array('alt' => get_the_title())); echo '</a>'; } ?> </div> </div> <div class="event-content"> <div class="page-heading-wrap"> <h2><?php the_title(); ?> </h2> <?php if ($post->GummOption['display_rating'] !== 'false') { View::renderElement('layout-components-parts/event/rating', array('rating' => (int) $post->PostMeta['event_rating'])); } ?> </div> <div class="event-inner-content-wrap"> <?php the_excerpt(); ?> <a href="<?php echo $this->getPermalink($post); ?> " class="event-more-link icon-plus"></a> </div> </div> </div> </div> </div> <?php } wp_reset_query(); }
/** * Redirect * * @param string $uri * @param string $message */ public function redirect($uri, $message = '', $code = 302) { if (!empty($uri)) { if (!empty($message)) { setcookie('message', $message, time() + 60, '/'); } if ($this->config->get('debug')) { View::renderElement('debug/backtrace', array('bt' => debug_backtrace(), 'url' => $uri, 'code' => $code, 'message' => $message)); } else { header('Location: ' . $uri, true, $code); } exit; } }
/** * @return void */ protected function _render($options) { $columns = (int) $this->getParam('postColumns'); $rowSpan = 12 / $columns; $foundPosts = count($this->posts); $rowClass = array('row-fluid'); if ($this->shouldPaginate) { $rowClass[] = 'slides-container'; } $filterableItems = false; if ($this->getParam('layout') == 'grid' && $this->getParam('categoriesFilter')) { View::renderElement('layout-components-parts/categories-list', array('postType' => $this->getParam('postType'))); $filterableItems = true; } if ($filterableItems) { echo '<div class="gumm-filterable-items" data-columns="' . $columns . '">'; } echo '<div class="' . implode(' ', $rowClass) . '">'; // Loop the shit out of it $counter = 1; global $post; foreach ($this->posts as $post) { // while (have_posts()): the_post(); global $post; $spanClass = array('span' . $rowSpan, 'roki-portfolio-thumbs', 'gumm-filterable-item'); if ($this->shouldPaginate && $counter > $columns) { $spanClass[] = 'hidden'; } $categories = $this->Wp->getPostCategories($post); foreach ($categories as $catId => $catName) { $spanClass[] = 'for-category-' . $catId; } ?> <div class="<?php echo implode(' ', $spanClass); ?> "> <div class="gallery-wrap preloading-image-holder"> <div class="image-container image-wrap"> <?php if ($post->Thumbnail) { ?> <a href="<?php the_permalink(); ?> "> <?php echo $this->Media->display($post->Thumbnail->guid, array('ar' => 1.33678756477, 'context' => 'span' . $rowSpan), array('alt' => get_the_title())); ?> <span class="image-detail"></span> </a> <?php View::renderElement('layout-components-parts/thumb-links', array('permalink' => get_permalink($post->ID), 'lightBoxLink' => $post->Thumbnail->permalink, 'rel' => $this->htmlElementId)); ?> <?php } ?> <h4> <a class="image-title" href="<?php the_permalink(); ?> "> <span class="bullet-detail"></span><?php the_title(); ?> </a> </h4> </div> <div class="bg-sheet-2"></div> <div class="bg-sheet-3"></div> </div> </div> <?php if ($counter % $columns === 0 && $counter < $foundPosts && $this->getParam('layout') === 'grid') { echo '</div><div class="row-fluid">'; } $counter++; // endwhile; } if ($filterableItems) { echo '</div>'; } echo '</div>'; }
protected function _render($options) { View::renderElement('google-map', $this->getParam('googleMap')); }
/** * @return void */ public function display() { View::renderElement(basename(GUMM_LAYOUT_ELEMENTS) . DS . $this->name(), $this->settings); }
/** * Renders a layout. Returns output from _render(). Returns false on error. * * @param string $content_for_layout Content to render in a view, wrapped by the surrounding layout. * @return mixed Rendered output, or false on error */ function renderLayout($content_for_layout, $layout = null) { $layout_fn = $this->_getLayoutFileName($layout); $debug = ''; if (isset($this->viewVars['cakeDebug']) && Configure::read() > 2) { $debug = View::renderElement('dump', array('controller' => $this->viewVars['cakeDebug']), false); unset($this->viewVars['cakeDebug']); } if ($this->pageTitle !== false) { $pageTitle = $this->pageTitle; } else { $pageTitle = Inflector::humanize($this->viewPath); } $data_for_layout = array_merge($this->viewVars, array('title_for_layout' => $pageTitle, 'content_for_layout' => $content_for_layout, 'scripts_for_layout' => join("\n\t", $this->__scripts), 'cakeDebug' => $debug)); if (empty($this->loaded) && !empty($this->helpers)) { $loadHelpers = true; } else { $loadHelpers = false; $data_for_layout = array_merge($data_for_layout, $this->loaded); } if (substr($layout_fn, -3) === 'ctp' || substr($layout_fn, -5) === 'thtml') { $out = View::_render($layout_fn, $data_for_layout, $loadHelpers, true); } else { $out = $this->_render($layout_fn, $data_for_layout, $loadHelpers); } if ($out === false) { $out = $this->_render($layout_fn, $data_for_layout); trigger_error(sprintf(__("Error in layout %s, got: <blockquote>%s</blockquote>", true), $layout_fn, $out), E_USER_ERROR); return false; } return $out; }