Beispiel #1
0
<?php

// VoteForBernie includes
$vfb_includes = array('lib/init.php', 'lib/assets.php', 'lib/models/post-model.php', 'lib/models/state-model.php', 'lib/services/state-service.php', 'lib/helpers/vote-info-helper.php', 'lib/comments.php');
foreach ($vfb_includes as $file) {
    if (!($filepath = locate_template($file))) {
        trigger_error(sprtinf('Error locating %s for inclusion', $file), E_USER_ERROR);
    }
    require_once $filepath;
}
// cleanup global vars
unset($file, $filepath);
Beispiel #2
0
 /**
  * Implements SeekableIterator::seek()
  *
  * @param  int $index
  * @throws OutOfBoundsException
  * @return void
  */
 public function seek($index)
 {
     $indexInt = (int) $index;
     if ($indexInt >= 0 && (null === $this->_results || $indexInt < $this->_results->length)) {
         $this->_currentIndex = $indexInt;
     } else {
         throw new OutOfBoundsException(sprtinf('Illegal index %s', $index));
     }
 }
Beispiel #3
0
<?php

import('session');
import('products');
import('forms');
$category = product_category_get($_GET['PRODUCT_CATEGORY_ID']);
if (!empty($category)) {
    $product = products_get_by_type($_GET['PRODUCT_CATEGORY_ID'], PRODUCT_VISUAL);
    $assocs = product_assoc_get($product['PRODUCT_ID'], PRODUCT_ASSOC_VARIANT);
} else {
    $errors[] = sprtinf('Category: "%s" does not exist');
}
// If there was an error we display it
if (isset($_GET['ERROR'])) {
    $errors[] = $_GET['ERROR'];
}
if (isset($_GET['success'])) {
    $success[] = $_GET['success'];
}
// If the clients wants to do a recalculation then we
// set the post to the current calculation and the the
// view will take care of the rest
if (isset($_GET['recalculate'])) {
    if (!empty($_SESSION['CURRENT_CALCULATION'])) {
        $_POST = $_SESSION['CURRENT_CALCULATION'];
    }
}
$template = 'order';
$link = THEME . 'template.php';
require_once $link;
Beispiel #4
0
/**
 * Option for selecting a custom layout that gets
 * inserted into out Hi-jacked "Page Attributes"
 * meta box.
 *
 * @since 2.0.0
 *
 * @param $layout string current custom layout
 * @param $output string HTML to output
 */
function themeblvd_custom_layout_dropdown($layout = null)
{
    // Make sure layout builder plugin is installed
    if (!defined('TB_BUILDER_PLUGIN_VERSION')) {
        $message = sprintf(__('In order to use the "Custom Layout" template, you must have the %s plugin installed.', 'themeblvd'), '<a href="http://wordpress.org/extend/plugins/theme-blvd-layout-builder" target="_blank">Theme Blvd Layout Builder</a>');
        return sprtinf('<p class="tb_custom_layout"><em>%s</em></p>', $message);
    }
    $custom_layouts = get_posts('post_type=tb_layout&numberposts=-1');
    $output = '<p><strong>' . __('Custom Layout', 'themeblvd') . '</strong></p>';
    if (!empty($custom_layouts)) {
        $output .= '<select name="_tb_custom_layout">';
        foreach ($custom_layouts as $custom_layout) {
            $output .= sprintf('<option value="%s" %s>%s</option>', $custom_layout->post_name, selected($custom_layout->post_name, $layout, false), $custom_layout->post_title);
        }
        $output .= '</select>';
    } else {
        $output .= '<p class="tb_custom_layout"><em>' . __('You haven\'t created any custom layouts in the Layout builder yet.', 'themeblvd') . '</em></p>';
    }
    return $output;
}
Beispiel #5
0
 /**
  * Returns the ID of the widget or generates a new one if not set.
  * @return string id of the widget.
  */
 public function getId()
 {
     if ($this->_id === null) {
         $this->_id = sprtinf('msmv-%s', self::$idCounter++);
     }
     return $this->_id;
 }