PHP extract Examples

PHP extract - 30 examples found. These are the top rated real world PHP examples of extract extracted from open source projects. You can rate examples to help us improve the quality of examples.
Example #1
3
 public function partial($partial, $__time = false, $params = null, $group = 'kumbia.partials')
 {
     //        if (PRODUCTION && $__time && !Cache::driver()->start($__time, $partial, $group)) {
     //            return;
     //        }
     //Verificando el partials en el dir app
     $__file = $this->viewPath . "/_shared/partials/{$partial}.phtml";
     //        if (!is_file($__file)) {
     //            //Verificando el partials en el dir core
     //            $__file = CORE_PATH . "views/partials/$partial.phtml";
     //        }
     if ($params) {
         if (is_string($params)) {
             $params = Util::getParams(explode(',', $params));
         }
         // carga los parametros en el scope
         extract($params, EXTR_OVERWRITE);
     }
     // carga la vista parcial
     if (!(include $__file)) {
         throw new \Exception('Vista Parcial "' . $__file . '" no se encontro');
     }
     // se guarda en la cache de ser requerido
     //        if (PRODUCTION && $__time) {
     //            Cache::driver()->end();
     //        }
 }
Example #2
1
 function render($atts)
 {
     $this->block_uid = td_global::td_generate_unique_id();
     //update unique id on each render
     extract(shortcode_atts(array('limit' => 3, 'sort' => '', 'category_id' => '', 'category_ids' => '', 'custom_title' => '', 'custom_url' => '', 'hide_title' => '', 'show_child_cat' => '', 'tag_slug' => '', 'header_color' => ''), $atts));
     $buffy = '';
     //output buffer
     $td_unique_id = td_global::td_generate_unique_id();
     $td_query =& td_data_source::get_wp_query($atts);
     //by ref  do the query
     //get the js for this block
     $buffy .= $this->get_block_js($atts, $td_query);
     $buffy .= '<div class="td_block_wrap td_block7">';
     //get the block title
     $buffy .= $this->get_block_title($atts);
     //get the sub category filter for this block
     $buffy .= $this->get_block_sub_cats($atts, $td_unique_id);
     $buffy .= '<div id=' . $this->block_uid . ' class="td_block_inner">';
     //inner content of the block
     $buffy .= $this->inner($td_query->posts);
     $buffy .= '</div>';
     //get the ajax pagination for this block
     $buffy .= $this->get_block_pagination($atts, $td_unique_id);
     $buffy .= '</div> <!-- ./block1 -->';
     return $buffy;
 }
 /**
  * s2Member's PayPal Auto-Return/PDT handler (inner processing routine).
  *
  * @package s2Member\PayPal
  * @since 110720
  *
  * @param array $vars Required. An array of defined variables passed by {@link s2Member\PayPal\c_ws_plugin__s2member_paypal_return_in::paypal_return()}.
  * @return array|bool The original ``$paypal`` array passed in (extracted) from ``$vars``, or false when conditions do NOT apply.
  */
 public static function cp($vars = array())
 {
     extract($vars);
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action("ws_plugin__s2member_during_paypal_return_before_no_return_data", get_defined_vars());
     unset($__refs, $__v);
     $paypal["s2member_log"][] = "No Return-Data. Customer MUST wait for Email Confirmation.";
     $paypal["s2member_log"][] = "Note. This can sometimes happen when/if you are offering an Initial/Trial Period. There are times when a Payment Gateway will NOT supply s2Member with any data immediately after checkout. When/if this happens, s2Member must process the transaction via IPN only (i.e. behind-the-scene), and the Customer must wait for Email Confirmation in these cases.";
     $paypal["s2member_log"][] = var_export($_REQUEST, true);
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action("ws_plugin__s2member_during_paypal_return_during_no_return_data", get_defined_vars());
     unset($__refs, $__v);
     if ($custom_success_redirection) {
         $paypal["s2member_log"][] = "Redirecting Customer to a custom URL: " . $custom_success_redirection . ".";
         wp_redirect($custom_success_redirection);
     } else {
         $paypal["s2member_log"][] = "Redirecting Customer to the Home Page (after asking Customer to check their email).";
         echo c_ws_plugin__s2member_return_templates::return_template($paypal["subscr_gateway"], _x('<strong>Thank you! (you MUST check your email before proceeding).</strong><br /><br />* Note: It can take <em>(up to 15 minutes)</em> for Email Confirmation with important details. If you don\'t receive email confirmation in the next 15 minutes, please contact Support.', "s2member-front", "s2member") . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"] || c_ws_plugin__s2member_utils_conds::pro_is_installed() && !empty($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_" . $paypal["subscr_gateway"] . "_sandbox"]) ? '<br /><br />' . _x('<strong>** Sandbox Mode **</strong> You may NOT receive this Email in Sandbox Mode. Sandbox addresses are usually bogus (for testing).', "s2member-front", "s2member") : ''), _x("Back To Home Page", "s2member-front", "s2member"), home_url("/"));
     }
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action("ws_plugin__s2member_during_paypal_return_after_no_return_data", get_defined_vars());
     unset($__refs, $__v);
     return apply_filters("c_ws_plugin__s2member_paypal_return_in_no_tx_data", $paypal, get_defined_vars());
 }
function smarty_function_link_list($params, &$smarty1)
{
    global $smarty;
    global $db;
    global $cfg;
    $tbl_link = $cfg['tbl_link'];
    if (empty($params['template'])) {
        $template = "link_list.html";
    }
    if (empty($params['count'])) {
        $count = 5;
    }
    if (empty($params['catalog_id'])) {
        print "function article_detail required catalog_id";
        return;
    }
    extract($params);
    if ($smarty->is_cached($template, $catalog_id)) {
        $smarty->display($template, $catalog_id);
        return;
    }
    $sql = "select name , url , descri ,logo ,sort_order from {$tbl_link} where catalog = {$catalog_id} order by sort_order desc limit {$count}";
    $rs = $db->Execute($sql);
    $links = array();
    while ($arr = $rs->FetchRow()) {
        array_push($links, $arr);
    }
    $rs->close();
    $smarty->assign("links", $links);
    $smarty->display($template, $catalog_id);
}
Example #5
1
 public function render()
 {
     extract($this->pageVars);
     ob_start();
     require $this->template;
     echo ob_get_clean();
 }
Example #6
1
/**
 * Retourne le lien absolu
 */
function get_absolute_link($relative_link, $url)
{
    /* return if already absolute URL */
    if (parse_url($relative_link, PHP_URL_SCHEME) != '') {
        return $relative_link;
    }
    /* queries and anchors */
    if ($relative_link[0] == '#' || $relative_link[0] == '?') {
        return $url . $relative_link;
    }
    /* parse base URL and convert to local variables:
       $scheme, $host, $path */
    extract(parse_url($url));
    /* remove non-directory element from path */
    $path = preg_replace('#/[^/]*$#', '', $path);
    /* destroy path if relative url points to root */
    if ($relative_link[0] == '/') {
        $path = '';
    }
    /* dirty absolute URL */
    $abs = $host . $path . '/' . $relative_link;
    /* replace '//' or '/./' or '/foo/../' with '/' */
    $re = array('#(/\\.?/)#', '#/(?!\\.\\.)[^/]+/\\.\\./#');
    for ($n = 1; $n > 0; $abs = preg_replace($re, '/', $abs, -1, $n)) {
    }
    /* absolute URL is ready! */
    return $scheme . '://' . $abs;
}
Example #7
1
 public function set($var, $value = null)
 {
     // parse variable name
     extract($this->_parse($var));
     if (!empty($name)) {
         // set default hash to method
         if ($hash == 'default') {
             $hash = 'method';
         }
         // set a array value ?
         if (strpos($name, '.') !== false) {
             $parts = explode('.', $name);
             $name = array_shift($parts);
             $array =& $this->_call(array($this->_class, 'getVar'), array($name, array(), $hash, 'array'));
             $val =& $array;
             foreach ($parts as $i => $part) {
                 if (!isset($array[$part])) {
                     $array[$part] = array();
                 }
                 if (isset($parts[$i + 1])) {
                     $array =& $array[$part];
                 } else {
                     $array[$part] = $value;
                 }
             }
             $value = $val;
         }
         $this->_call(array($this->_class, 'setVar'), array($name, $value, $hash));
     }
     return $this;
 }
Example #8
1
 /**
  * PC标签中调用数据
  * @param array $data 配置数据
  */
 public function pc_tag($data)
 {
     $siteid = isset($data['siteid']) && intval($data['siteid']) ? intval($data['siteid']) : get_siteid();
     $r = $this->db->select(array('pos' => $data['pos'], 'siteid' => $siteid));
     $str = '';
     if (!empty($r) && is_array($r)) {
         foreach ($r as $v) {
             if (defined('IN_ADMIN') && !defined('HTML')) {
                 $str .= '<div id="block_id_' . $v['id'] . '" class="admin_block" blockid="' . $v['id'] . '">';
             }
             if ($v['type'] == '2') {
                 extract($v, EXTR_OVERWRITE);
                 $data = string2array($data);
                 if (!defined('HTML')) {
                     ob_start();
                     include $this->template_url($id);
                     $str .= ob_get_contents();
                     ob_clean();
                 } else {
                     include $this->template_url($id);
                 }
             } else {
                 $str .= $v['data'];
             }
             if (defined('IN_ADMIN') && !defined('HTML')) {
                 $str .= '</div>';
             }
         }
     }
     return $str;
 }
Example #9
1
function template($filename, $flag = TEMPLATE_DISPLAY)
{
    global $_W;
    $source = IA_ROOT . "/web/themes/{$_W['template']}/{$filename}.html";
    $compile = IA_ROOT . "/data/tpl/web/{$_W['template']}/{$filename}.tpl.php";
    if (!is_file($source)) {
        $source = IA_ROOT . "/web/themes/default/{$filename}.html";
        $compile = IA_ROOT . "/data/tpl/web/default/{$filename}.tpl.php";
    }
    if (!is_file($source)) {
        exit("Error: template source '{$filename}' is not exist!");
    }
    if (DEVELOPMENT || !is_file($compile) || filemtime($source) > filemtime($compile)) {
        template_compile($source, $compile);
    }
    switch ($flag) {
        case TEMPLATE_DISPLAY:
        default:
            extract($GLOBALS, EXTR_SKIP);
            include $compile;
            break;
        case TEMPLATE_FETCH:
            extract($GLOBALS, EXTR_SKIP);
            ob_clean();
            ob_start();
            include $compile;
            $contents = ob_get_contents();
            ob_clean();
            return $contents;
            break;
        case TEMPLATE_INCLUDEPATH:
            return $compile;
            break;
    }
}
Example #10
0
 /**
  * Helper to show a "note" based on a hidden value.
  *
  * @access public
  *
  * @param string|array $name If a string, the element name.  If an
  * array, all other parameters are ignored, and the array elements
  * are extracted in place of added parameters.
  *
  * @param array $value The note to display.  HTML is *not* escaped; the
  * note is displayed as-is.
  *
  * @return string The element XHTML.
  */
 public function formNote($name, $value = null)
 {
     $info = $this->_getInfo($name, $value);
     extract($info);
     // name, value, attribs, options, listsep, disable
     return $value;
 }
 /**
  * Outputs the HTML for this widget.
  *
  * @param array  An array of standard parameters for widgets in this theme 
  * @param array  An array of settings for this widget instance 
  * @return void Echoes it's output
  **/
 public function widget($args, $instance)
 {
     extract($args, EXTR_SKIP);
     $count = esc_attr($instance['count']);
     $count = 0 < $count && $count < 10 ? $count : 2;
     $loop = new WP_Query(array('post_type' => 'event', 'posts_per_page' => $count, 'order' => 'ASC', 'orderby' => 'meta_value_num', 'meta_key' => '_event_start', 'meta_query' => array(array('key' => '_event_end', 'value' => time(), 'compare' => '>'))));
     if ($loop->have_posts()) {
         echo $before_widget;
         if ($instance['title']) {
             echo $before_title . apply_filters('widget_title', $instance['title']) . $after_title;
         }
         echo '<ul>';
         while ($loop->have_posts()) {
             $loop->the_post();
             global $post;
             $output = '<span class="meta">' . date(get_option('date_format'), get_post_meta(get_the_ID(), '_event_start', true)) . '</span> <a href="' . get_permalink() . '">' . get_the_title() . '</a>';
             $read_more = apply_filters('em4wp_events_manager_upcoming_widget_output', $output, $post);
             if ($read_more) {
                 echo '<li>' . $read_more . '</li>';
             }
         }
         if ($instance['more_text']) {
             echo '<li><a href="' . get_post_type_archive_link('event') . '">' . esc_attr($instance['more_text']) . '</a></li>';
         }
         echo '</ul>';
         echo $after_widget;
     }
     wp_reset_postdata();
 }
Example #12
0
 protected function content($atts, $content = null)
 {
     $title = $address = $size = $zoom = $pin_image = $type = $el_position = $width = $el_class = '';
     extract(shortcode_atts(array('title' => '', 'full_width' => '', 'address' => '', 'size' => 200, 'zoom' => 14, 'pin_image' => '', 'type' => 'm', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts));
     $output = '';
     if ($address == '') {
         return null;
     }
     $el_class = $this->getExtraClass($el_class);
     $width = wpb_translateColumnWidthToSpan($width);
     $size = str_replace(array('px', ' '), array('', ''), $size);
     $map_coords = map_embed($address);
     $img_url = wp_get_attachment_image_src($pin_image, 'full');
     if ($full_width == "yes") {
         $output .= "\n\t" . '<div class="wpb_gmaps_widget full-width wpb_content_element ' . $width . $el_class . '">';
     } else {
         $output .= "\n\t" . '<div class="wpb_gmaps_widget wpb_content_element ' . $width . $el_class . '">';
     }
     $output .= "\n\t\t" . '<div class="wpb_wrapper">';
     $output .= $title != '' ? "\n\t\t\t" . '<h3 class="wpb_heading wpb_video_heading">' . $title . '</h3>' : '';
     $output .= '<div class="wpb_map_wraper"><div class="map-canvas" style="width:100%;height:' . $size . 'px;" data-address="' . $address . '" data-lat="' . $map_coords['lat'] . '" data-long="' . $map_coords['long'] . '" data-zoom="' . $zoom . '" data-maptype="' . $type . '" data-pinimage="' . $img_url[0] . '"></div></div>';
     $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.wpb_wrapper');
     $output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
     $output = $this->startRow($el_position) . $output . $this->endRow($el_position);
     global $include_maps;
     $include_maps = true;
     return $output;
 }
 public function run(&$_data)
 {
     $engine = strtolower(C('TMPL_ENGINE_TYPE'));
     if ('think' == $engine) {
         // 采用Think模板引擎
         if ($this->checkCache($_data['file'])) {
             // 缓存有效
             // 分解变量并载入模板缓存
             extract($_data['var'], EXTR_OVERWRITE);
             //载入模版缓存文件
             include C('CACHE_PATH') . md5($_data['file']) . C('TMPL_CACHFILE_SUFFIX');
         } else {
             $tpl = Think::instance('ThinkTemplate');
             // 编译并加载模板文件
             $tpl->fetch($_data['file'], $_data['var']);
         }
     } else {
         // 调用第三方模板引擎解析和输出
         $class = 'Template' . ucwords($engine);
         if (is_file(CORE_PATH . 'Driver/Template/' . $class . '.class.php')) {
             // 内置驱动
             $path = CORE_PATH;
         } else {
             // 扩展驱动
             $path = EXTEND_PATH;
         }
         if (require_cache($path . 'Driver/Template/' . $class . '.class.php')) {
             $tpl = new $class();
             $tpl->fetch($_data['file'], $_data['var']);
         } else {
             // 类没有定义
             throw_exception(L('_NOT_SUPPERT_') . ': ' . $class);
         }
     }
 }
Example #14
0
function sp_carousel_item_addon($atts)
{
    extract(spAddonAtts(array("title" => '', "bg" => '', 'content' => '', "button_text" => '', "button_url" => '', "button_size" => '', "button_type" => '', "button_icon" => ''), $atts));
    if ($button_icon) {
        $button_text = '<i class="fa ' . $button_icon . '"></i> ' . $button_text;
    }
    $has_bg = '';
    if ($bg) {
        $has_bg = ' sppb-item-has-bg';
    }
    $output = '<div class="sppb-item' . $has_bg . '">';
    if ($bg) {
        $output .= '<img src="' . $bg . '" alt="' . $title . '">';
    }
    $output .= '<div class="sppb-carousel-item-inner">';
    $output .= '<div class="sppb-carousel-caption">';
    $output .= '<div class="sppb-carousel-pro-text">';
    if ($title || $content) {
        if ($title != '') {
            $output .= '<h2>' . $title . '</h2>';
        }
        $output .= '<p>' . $content . '</p>';
        if ($button_text && $button_url) {
            $output .= '<a href="' . $button_url . '" class="sppb-btn sppb-btn-' . $button_type . ' sppb-btn-' . $button_size . '" role="button">' . $button_text . '</a>';
        }
    }
    $output .= '</div>';
    $output .= '</div>';
    $output .= '</div>';
    $output .= '</div>';
    return $output;
}
Example #15
0
 public function getCalendarWidget()
 {
     $instance = array('order' => '12', 'name' => 'Events', 'size' => 'span8', 'title' => 'Events', 'parent' => '0', 'number' => '16', 'first' => true, 'resizable' => 1, 'see_all' => 'See All', 'itemno' => '7', 'template_id' => '16', 'block_id' => 'aq_block_16');
     extract($instance);
     global $icy_options;
     require_once __DIR__ . "/../views/frontend/calendar-widget.php";
 }
    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', empty($instance['title']) ? __('Pages') : $instance['title']);
        $sortby = empty($instance['sortby']) ? 'menu_order' : $instance['sortby'];
        $exclude = empty($instance['exclude']) ? '' : $instance['exclude'];
        if ($sortby == 'post_date') {
            $showdate = "created";
        }
        if ($sortby == 'menu_order') {
            $sortby = 'menu_order, post_title, post_date';
        }
        $out = wp_list_pages(apply_filters('widget_pages_args', array('title_li' => '', 'echo' => 0, 'sort_column' => $sortby, 'exclude' => $exclude, 'show_date' => $showdate)));
        if (!empty($out)) {
            echo $before_widget;
            if ($title) {
                echo $before_title . $title . $after_title;
            }
            ?>

		<ul>

			<?php 
            echo $out;
            ?>

		</ul>

		<?php 
            echo $after_widget;
        }
    }
Example #17
0
    function widget($args, $instance)
    {
        extract($args);
        $title = isset($instance['title']) && $instance['title'] ? $instance['title'] : __('Recent tags', 'p2');
        $num_to_show = isset($instance['num_to_show']) && (int) $instance['num_to_show'] ? (int) $instance['num_to_show'] : $this->default_num_to_show;
        $recent_tags = $this->recent_tags($num_to_show);
        echo $before_widget . $before_title . esc_html($title) . $after_title;
        echo "\t<ul>\n";
        foreach ($recent_tags as $recent) {
            ?>
		<li>
			<a href="<?php 
            echo esc_url($recent['link']);
            ?>
"><?php 
            echo esc_html($recent['tag']->name);
            ?>
</a>&nbsp;
			(&nbsp;<?php 
            echo number_format_i18n($recent['tag']->count);
            ?>
&nbsp;)
		</li>
	<?php 
        }
        ?>
	</ul>
	<?php 
        echo $after_widget;
    }
 /**
  * widget function.
  *
  * @access public
  * @param array $args
  * @param array $instance
  * @return void
  */
 public function widget($args, $instance)
 {
     // Twitter handle is required.
     if (!isset($instance['twitter_handle']) || $instance['twitter_handle'] == '') {
         return;
     }
     extract($args, EXTR_SKIP);
     /* Our variables from the widget settings. */
     $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
     /* Before widget (defined by themes). */
     echo $before_widget;
     /* Display the widget title if one was input (before and after defined by themes). */
     if ($title) {
         echo $before_title . $title . $after_title;
     }
     // End IF Statement
     /* Widget content. */
     // Add actions for plugins/themes to hook onto.
     do_action($this->woo_widget_cssclass . '_top');
     // Load widget content here.
     $html = '';
     $args = array('username' => sanitize_user(strip_tags($instance['twitter_handle'])), 'limit' => intval($instance['limit']), 'include_retweets' => (bool) $instance['include_retweets'], 'exclude_replies' => (bool) $instance['exclude_replies']);
     $tweets = $this->get_stored_data($args);
     if (is_array($tweets) && count($tweets) > 0) {
         $html .= '<ul class="tweets">' . "\n";
         foreach ($tweets as $k => $v) {
             $text = $v->text;
             if ($v->truncated == false) {
                 $text = make_clickable($text);
                 // Optionally find and link up mentions.
                 if (isset($instance['link_mentions']) && 1 == $instance['link_mentions']) {
                     $mentions = $this->find_mentions($text);
                     if (is_array($mentions)) {
                         foreach ($mentions as $i => $j) {
                             $text = str_replace('@' . $j, '<a href="' . esc_url('http://twitter.com/' . $j) . '" title="' . sprintf(esc_attr__('@%s on Twitter', 'woodojo'), $j) . '">' . '@' . $j . '</a>', $text);
                         }
                     }
                 }
             }
             $html .= '<li class="tweet-number-' . esc_attr($k + 1) . '">' . "\n";
             $html .= $text . "\n";
             $html .= '<small class="time-ago"><a href="' . esc_url('https://twitter.com/' . urlencode($instance['twitter_handle']) . '/status/' . $v->id_str) . '">' . human_time_diff(strtotime($v->created_at), current_time('timestamp')) . ' ' . __('ago', 'woodojo') . '</a>';
             if (isset($v->retweeted_status) && isset($v->retweeted_status->id_str) && isset($v->retweeted_status->user->screen_name)) {
                 $html .= ' ' . __('retweeted via', 'woodojo') . ' <a href="' . esc_url('https://twitter.com/' . urlencode($v->retweeted_status->user->screen_name) . '/status/' . $v->retweeted_status->id_str) . '">' . $v->retweeted_status->user->screen_name . '</a>';
             }
             $html .= '</small>' . "\n";
             $html .= '</li>' . "\n";
         }
         $html .= '</ul>' . "\n";
     }
     if ($instance['include_follow_link'] != false) {
         $html .= '<p class="follow-link"><a href="' . esc_url('http://twitter.com/' . urlencode($instance['twitter_handle'])) . '">' . sprintf(__('Follow %s on Twitter', 'woodojo'), $instance['twitter_handle']) . '</a></p>';
     }
     echo $html;
     // If using the $html variable to store the output, you need this. ;)
     // Add actions for plugins/themes to hook onto.
     do_action($this->woo_widget_cssclass . '_bottom');
     /* After widget (defined by themes). */
     echo $after_widget;
 }
Example #19
0
 /**
  * Front-end display of widget.
  *
  * @see WP_Widget::widget()
  *
  * @param array $args     Widget arguments.
  * @param array $instance Saved values from database.
  */
 public function widget($args, $instance)
 {
     extract($args);
     $title = apply_filters('widget_title', $instance['title']);
     echo $before_widget;
     if (!empty($title)) {
         echo $before_title . $title . $after_title;
     }
     $linked_page_is_set = 0 < strlen($instance['url_to_page']);
     $linked_page_id_is_set = 0 < (int) $instance['sc_id_for_url'];
     $shortcode = '[event-list show_nav=false';
     $shortcode .= ' num_events="' . $instance['num_events'] . '"';
     $shortcode .= ' title_length=' . $instance['title_length'];
     $shortcode .= ' show_starttime=' . $instance['show_starttime'];
     $shortcode .= ' show_location=' . $instance['show_location'];
     $shortcode .= ' location_length=' . $instance['location_length'];
     $shortcode .= ' show_details=' . $instance['show_details'];
     $shortcode .= ' details_length=' . $instance['details_length'];
     if ($linked_page_is_set && $linked_page_id_is_set) {
         $shortcode .= ' link_to_event=' . $instance['link_to_event'];
         $shortcode .= ' url_to_page="' . $instance['url_to_page'] . '"';
         $shortcode .= ' sc_id_for_url=' . $instance['sc_id_for_url'];
     } else {
         $shortcode .= ' link_to_event=false';
     }
     $shortcode .= ' cat_filter="' . $instance['category'] . '"';
     $shortcode .= ']';
     echo do_shortcode($shortcode);
     if ('true' === $instance['link_to_page'] && $linked_page_is_set) {
         echo '<div style="clear:both"><a title="' . $instance['link_to_page_caption'] . '" href="' . $instance['url_to_page'] . '">' . $instance['link_to_page_caption'] . '</a></div>';
     }
     echo $after_widget;
 }
Example #20
0
 private function requireInContext($file, $data)
 {
     // Create variable context
     extract($this->globals);
     extract((array) $data);
     require $file;
 }
 function widget($args, $instance)
 {
     extract($args, EXTR_SKIP);
     $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
     $sticky = get_option('sticky_posts');
     $number = empty($instance['number']) ? 1 : (int) $instance['number'];
     $cat = empty($instance['category']) ? 0 : (int) $instance['category'];
     if (is_single()) {
         array_push($sticky, get_the_ID());
     }
     echo $before_widget;
     if (!empty($title)) {
         echo $before_title . $title . $after_title;
     } else {
         echo '<br />';
     }
     $featuredPosts = new WP_Query(array('posts_per_page' => $number, 'cat' => $cat, 'post__not_in' => $sticky, 'no_found_rows' => true));
     while ($featuredPosts->have_posts()) {
         $featuredPosts->the_post();
         global $mb_content_area, $more;
         $mb_content_area = 'sidebar';
         get_template_part('content', get_post_format());
     }
     wp_reset_postdata();
     echo $after_widget;
 }
Example #22
0
 function st_vc_single_search($attr, $content = false)
 {
     $data = shortcode_atts(array('st_list_form' => '', 'st_style_search' => 'style_1', 'st_direction' => 'horizontal', 'st_box_shadow' => 'no', 'st_search_tabs' => 'yes', 'st_title_search' => '', 'field_size' => '', 'active' => 1), $attr, 'st_single_search');
     extract($data);
     $txt = st()->load_template('vc-elements/st-single-search/search', 'form', array('data' => $data));
     return $txt;
 }
Example #23
0
 function parse()
 {
     if (isset($this->vars)) {
         extract($this->vars);
     }
     include $this->file;
 }
Example #24
0
 /**
  * Generates a 'checkbox' element.
  *
  * @access public
  *
  * @param string|array $name If a string, the element name.  If an
  * array, all other parameters are ignored, and the array elements
  * are extracted in place of added parameters.
  * @param mixed $value The element value.
  * @param array $attribs Attributes for the element tag.
  * @return string The element XHTML.
  */
 public function formCheckbox($name, $value = null, $attribs = null, array $checkedOptions = null)
 {
     $info = $this->_getInfo($name, $value, $attribs);
     extract($info);
     // name, id, value, attribs, options, listsep, disable
     $checked = false;
     if (isset($attribs['checked']) && $attribs['checked']) {
         $checked = true;
         unset($attribs['checked']);
     } elseif (isset($attribs['checked'])) {
         $checked = false;
         unset($attribs['checked']);
     }
     $checkedOptions = self::determineCheckboxInfo($value, $checked, $checkedOptions);
     // is the element disabled?
     $disabled = '';
     if ($disable) {
         $disabled = ' disabled="disabled"';
     }
     // build the element
     $xhtml = '';
     if (!$disable && !strstr($name, '[]') && (empty($attribs['disableHidden']) || !$attribs['disableHidden'])) {
         $xhtml = $this->_hidden($name, $checkedOptions['uncheckedValue']);
     }
     if (array_key_exists('disableHidden', $attribs)) {
         unset($attribs['disableHidden']);
     }
     $xhtml .= '<input type="checkbox"' . ' name="' . $this->view->escape($name) . '"' . ' id="' . $this->view->escape($id) . '"' . ' value="' . $this->view->escape($checkedOptions['checkedValue']) . '"' . $checkedOptions['checkedString'] . $disabled . $this->_htmlAttribs($attribs) . $this->getClosingBracket();
     return $xhtml;
 }
function OUTPUT($_POST)
{
    extract($_POST);
    $typeid = remval($typeid);
    # Set up table to display in
    $OUTPUT .= "<td valign=top width='33%'>\r\n<table border=0 width='90%'>\r\n<tr><td align=center nowrap><h3>Document Data</h3></td></tr>\r\n<tr><th>Type</th><th>Ref</th><th>Document</th><th>Date</th><th>Description</th><th>Filename</th></tr>";
    if ($typeid != '0') {
        $whe = "AND typeid='{$typeid}' ";
    } else {
        $whe = "";
    }
    # Connect to database
    //db_conn (YR_DB);
    db_conn("yr2");
    # Query server
    $i = 0;
    $sql = "SELECT * FROM documents WHERE div = '" . USER_DIV . "' {$whe} ORDER BY docname ASC";
    $docRslt = db_exec($sql) or errDie("Unable to retrieve Documents from database.");
    if (pg_numrows($docRslt) < 1) {
        return "<li>There are no Documents in Cubit.</li>\r\n\t\t\t <p>\r\n\t\t\t <table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "' width=15%>\r\n\t\t<tr><td><br></td></tr>\r\n\t\t<tr><th>Quick Links</th></tr>\r\n\t\t<tr class='bg-odd'><td><a href='docadd.php'>Add Document</a></td></tr>\r\n\t\t<tr class='bg-odd'><td><a href='docview.php'>View Documents</a></td></tr>\r\n\t\t<tr class='bg-odd'><td><a href='../main.php'>Main Menu</a></td></tr>\r\n\t\t<tr class='bg-odd'><td><a href='docman-index.php'>Back</a></td></tr>\r\n\t\t</table>";
    }
    while ($doc = pg_fetch_array($docRslt)) {
        $OUTPUT .= "<tr class='" . bg_class() . "'><td>{$doc['typename']}</td><td>{$doc['docref']}</td><td>{$doc['docname']}</td><td>{$doc['docdate']}</td><td>{$doc['descrip']}</td><td>{$doc['filename']}</td><td><a href='docedit.php?docid={$doc['docid']}'>Edit</a></td>";
        $OUTPUT .= "<td><a href='docdload.php?docid={$doc['docid']}'>Download</a></td><td><a href='docrem.php?docid={$doc['docid']}'>Remove</a></td></tr>";
        $i++;
    }
    $OUTPUT .= "</table></td>";
    return $OUTPUT;
}
 /**
  * Implements ctools_export_ui::edit_form().
  */
 function edit_form(&$form, &$form_state)
 {
     parent::edit_form($form, $form_state);
     $retrieve_plugins = mailhandler_get_plugins('mailhandler', 'retrieve');
     if (count($retrieve_plugins) == 1) {
         mailhandler_report('warning', 'No retrieval plugins are available. Please <a href="@module-page">enable a module</a> providing a retrieval plugin, such as the Mailhandler PHP IMAP module.', array('@module-page' => url('admin/modules')));
     }
     global $cookie_domain;
     extract($form_state['item']->settings);
     $form['info']['admin_title']['#description'] = t('Suggested, but not required, to be the email address of the mailbox.');
     $form['connection']['#tree'] = FALSE;
     $form['connection']['settings'] = array('#type' => 'fieldset', '#title' => 'Mailbox connection settings', '#tree' => TRUE, '#collapsible' => TRUE, '#after_build' => array('_mailhandler_include_js'));
     $form['connection']['settings']['type'] = array('#type' => 'select', '#title' => t('Protocol'), '#options' => array('imap' => 'IMAP', 'pop3' => 'POP3', 'local' => 'Local mbox file'), '#default_value' => $type, '#description' => t('You can use the IMAP/POP3 protocols, or retrieve from an mbox file on the local file system.'));
     $ajax_settings = array('callback' => '_mailhandler_mailbox_test', 'wrapper' => 'mailhandler_test_results', 'event' => 'change', 'progress' => array('type' => 'throbber', 'message' => t('Please wait - testing connection settings...')));
     $form['connection']['settings']['folder'] = array('#type' => 'textfield', '#title' => t('Folder'), '#default_value' => $folder, '#description' => t('The folder where the mail is stored. If you want this mailbox to read from a local mbox file, give an absolute path or the path relative to the Drupal installation directory.'), '#ajax' => $ajax_settings);
     $form['connection']['settings']['domain'] = array('#type' => 'textfield', '#title' => t('Domain'), '#default_value' => $domain ? $domain : trim($cookie_domain, '.'), '#description' => t('The domain of the server used to collect mail.'), '#ajax' => $ajax_settings);
     $form['connection']['settings']['port'] = array('#type' => 'textfield', '#title' => t('Port'), '#size' => 5, '#maxlength' => 5, '#default_value' => $port, '#description' => t('The mailbox port number (usually 110 for POP3, 143 for IMAP).'), '#element_validate' => array('element_validate_integer_positive'), '#ajax' => $ajax_settings);
     $form['connection']['settings']['name'] = array('#type' => 'textfield', '#title' => t('Username'), '#default_value' => $name, '#description' => t('This username is used while logging into this mailbox during mail retrieval.'), '#ajax' => $ajax_settings);
     $form['connection']['settings']['pass'] = array('#type' => 'textfield', '#title' => t('Password'), '#default_value' => $pass, '#description' => t('The password corresponding to the username above. Consider using a non-vital password, since this field is stored without encryption in the database.'), '#ajax' => $ajax_settings);
     // Allow administrators to configure the mailbox with extra IMAP commands (notls, novalidate-cert etc.)
     $form['connection']['settings']['extraimap'] = array('#type' => 'textfield', '#title' => t('Extra commands'), '#default_value' => $extraimap, '#description' => t('In some circumstances you need to issue extra commands to connect to your mail server (e.g. "/notls", "/novalidate-cert" etc.). See documentation for <a href="@imap-open">imap_open</a>.', array('@imap-open' => url('http://php.net/imap_open'))), '#ajax' => $ajax_settings);
     $form['connection']['settings']['results'] = array('#type' => 'container', '#attributes' => array('id' => 'mailhandler_test_results'));
     $form['extra']['#tree'] = FALSE;
     $form['extra']['settings'] = array('#type' => 'fieldset', '#title' => 'More settings', '#tree' => TRUE, '#collapsible' => TRUE, '#collapsed' => TRUE);
     $form['extra']['settings']['limit'] = array('#type' => 'textfield', '#title' => t('Maximum messages to retrieve'), '#size' => 5, '#maxlength' => 5, '#default_value' => $limit, '#description' => t('To prevent timeout errors from large mailboxes you can limit the maximum number of messages that will be retrieved during each cron run. Set to zero for no limit.'), '#element_validate' => array('element_validate_integer'));
     $form['extra']['settings']['encoding'] = array('#type' => 'textfield', '#title' => t('Default character encoding'), '#default_value' => $encoding, '#description' => t('The default character encoding to use when an incoming message does not define an encoding.'));
     $form['extra']['settings']['flag_after_read'] = array('#type' => 'checkbox', '#title' => t('Mark messages as seen/read after they are processed?'), '#default_value' => isset($flag_after_read) ? $flag_after_read : TRUE, '#description' => t('Note that messages cannot be marked as seen/read for POP3 accounts.'));
     $form['extra']['settings']['delete_after_read'] = array('#type' => 'checkbox', '#title' => t('Delete messages after they are processed?'), '#default_value' => $delete_after_read, '#description' => t('Uncheck this box to leave read messages in the mailbox. They will not be processed again unless they become marked as unread.  If you selected "POP3" as your mailbox type, you must check this box.'));
     $form['extra']['settings']['fromheader'] = array('#type' => 'textfield', '#title' => t('From header'), '#default_value' => $fromheader, '#description' => t('Use this e-mail header to determine the author of the resulting node. <strong>Sender</strong> is useful when working with listservs.'));
     $form['extra']['settings']['security'] = array('#type' => 'radios', '#title' => t('Security'), '#options' => array(t('Disabled'), t('Require password')), '#default_value' => $security, '#description' => t('Disable security if your site does not require a password in the Commands section of incoming e-mails. Note: Security=Enabled and MIME preference=HTML is an unsupported combination.'));
     $form['extra']['settings']['replies'] = array('#type' => 'radios', '#title' => t('Send error replies'), '#options' => array(t('Disabled'), t('Enabled')), '#default_value' => $replies, '#description' => t('Send helpful replies to all unsuccessful e-mail submissions. Consider disabling when a listserv posts to this mailbox.'));
     $form['extra']['settings']['retrieve'] = array('#type' => 'select', '#title' => t('Retrieval library'), '#options' => _mailhandler_build_options($retrieve_plugins), '#default_value' => $retrieve, '#description' => t('The library that will be used to retrieve messages.'), '#required' => TRUE);
 }
Example #27
0
        function widget($args, $instance)
        {
            // prints the widget
            extract($args, EXTR_SKIP);
            $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
            $ads = empty($instance['ads']) ? '' : apply_filters('widget_ads', $instance['ads']);
            ?>
						
		   <div class="widget advt_widget">
				<?php 
            if ($title != "") {
                ?>
<h3><?php 
                echo $title;
                ?>
 </h3> <?php 
            }
            ?>
				<?php 
            echo $ads;
            ?>
 
			</div>        
		<?php 
        }
 function validate($data = null)
 {
     $this->errors = array();
     if (!empty($data)) {
         $data = empty($data[$this->model]) ? $data : $data[$this->model];
         foreach ($data as $dkey => $dval) {
             $this->data->{$dkey} = stripslashes($dval);
         }
         extract($data, EXTR_SKIP);
         if (empty($gallery_id)) {
             $this->errors['title'] = __('No gallery was specified', $this->plugin_name);
         }
         if (empty($slide_id)) {
             $this->errors['title'] = __('No slide was specified', $this->plugin_name);
         }
         if (empty($this->errors)) {
             if ($galleryslide = $this->find(array('gallery_id' => $gallery_id, 'slide_id' => $slide_id))) {
                 $this->data->id = $galleryslide->id;
             }
         }
     } else {
         $this->errors[] = __('No data was posted', $this->plugin_name);
     }
     return $this->errors;
 }
Example #29
0
 /**
  * Editor Element - this function defines the visual appearance of an element on the AviaBuilder Canvas
  * Most common usage is to define some markup in the $params['innerHtml'] which is then inserted into the drag and drop container
  * Less often used: $params['data'] to add data attributes, $params['class'] to modify the className
  *
  *
  * @param array $params this array holds the default values for $content and $args.
  * @return $params the return array usually holds an innerHtml key that holds item specific markup.
  */
 function editor_element($params)
 {
     extract($params);
     $name = $this->config['shortcode'];
     $drag = $this->config['drag-level'];
     $drop = $this->config['drop-level'];
     $size = array('av_one_full' => '1/1', 'av_one_half' => '1/2', 'av_one_third' => '1/3', 'av_one_fourth' => '1/4', 'av_one_fifth' => '1/5', 'av_two_third' => '2/3', 'av_three_fourth' => '3/4', 'av_two_fifth' => '2/5', 'av_three_fifth' => '3/5', 'av_four_fifth' => '4/5');
     $extraClass = isset($args[0]) ? $args[0] == 'first' ? ' avia-first-col' : "" : "";
     $output = "<div class='avia_layout_column avia_pop_class " . $name . $extraClass . " av_drag' data-dragdrop-level='{$drag}' data-width='{$name}'>";
     $output .= "<div class='avia_sorthandle menu-item-handle'>";
     $output .= "<a class='avia-smaller avia-change-col-size' href='#smaller' title='" . __('Decrease Column Size', 'avia_framework') . "'>-</a>";
     $output .= "<span class='avia-col-size'>" . $size[$name] . "</span>";
     $output .= "<a class='avia-bigger avia-change-col-size'  href='#bigger' title='" . __('Increase Column Size', 'avia_framework') . "'>+</a>";
     $output .= "<a class='avia-delete'  href='#delete' title='" . __('Delete Column', 'avia_framework') . "'>x</a>";
     //$output .= "<a class='avia-new-target'  href='#new-target' title='".__('Move Element','avia_framework' )."'>+</a>";
     $output .= "<a class='avia-clone'  href='#clone' title='" . __('Clone Column', 'avia_framework') . "' >" . __('Clone Column', 'avia_framework') . "</a></div>";
     $output .= "<div class='avia_inner_shortcode avia_connect_sort av_drop ' data-dragdrop-level='{$drop}'>";
     $output .= "<textarea data-name='text-shortcode' cols='20' rows='4'>" . ShortcodeHelper::create_shortcode_by_array($name, $content, $args) . "</textarea>";
     if ($content) {
         $content = $this->builder->do_shortcode_backend($content);
     }
     $output .= $content;
     $output .= "</div></div>";
     return $output;
 }
 /**
  * Columns shortcode
  *
  * @param array $atts
  * @param string $content
  * @return string
  */
 function wolf_columns_shortcode($atts, $content = null)
 {
     // if ( class_exists( 'Vc_Manager' ) && function_exists( 'vc_map_get_attributes' ) ) {
     // 	$atts = vc_map_get_attributes( 'wolf_column', $atts );
     // }
     extract(shortcode_atts(array('col' => 'col-6', 'class' => '', 'first' => '', 'last' => '', 'inline_style' => ''), $atts));
     $col = esc_attr($col);
     $first = esc_attr($first);
     $last = esc_attr($last);
     $col = esc_attr($col);
     $inline_style = sanitize_text_field($inline_style);
     $output = '';
     $style = '';
     $class = $class ? "{$class} " : '';
     // add space
     if ($inline_style) {
         $style .= $inline_style;
     }
     $style = $style ? " style='{$style}'" : '';
     if ($first) {
         $class = 'first';
     } elseif ($last) {
         $class = 'last';
     }
     if ($class == 'first') {
         $output .= '<div class="clear"></div>';
     }
     $output .= '<div class="' . $col . ' ' . $class . '"' . $style . '>' . do_shortcode($content) . '</div>';
     if ($class == 'last') {
         $output .= '<div class="clear"></div>';
     }
     return $output;
 }