function op_has_group_error($group) { return _op_tpl('has_group_error', $group); }
static function video_lightbox($atts, $content = '') { // Decode encoded chars $atts = op_urldecode($atts); //Initialize default array $default = array('placeholder' => '', 'type' => 'embed', 'hide_controls' => 'N', 'auto_play' => 'N', 'auto_buffer' => 'N', 'width' => 511, 'height' => 288, 'placeholder_width' => '', 'placeholder_height' => '', 'align' => 'center', 'style' => 1, 'url1' => '', 'url2' => ''); //Extract the attributes into the data array and if a value doesn't exist, use the defaults //This will be used for the templates $data = shortcode_atts($default, $atts); self::$add_pretty_photo = true; //If this is an embedded video code, the inline content, which is the embed code, must be processed if ($data['type'] == 'embed') { if (preg_match('{alt=\\"(.*?)\\"}si', $content, $match)) { $content = base64_decode(html_entity_decode($match[1], ENT_QUOTES, get_option('blog_charset'))); if (stripos($content, 'id="evp-') !== false) { $content = preg_replace('{<!--\\s+_evpInit}si', "<!--\n_evpInit", $content); } } $el = self::_get_element_number('video_lightbox'); $data['inlinecontent'] = '<div style="display:none"><div id="' . $el . '" style="width:' . $data['width'] . 'px;height:' . $data['height'] . 'px">' . $content . '</div></div>'; $data['url'] = '#' . $el; } else { //If this is a URL, then we must process the URL $data['url'] = ''; $content = base64_decode($content); if (preg_match('|(https?://[^<"]+)|im', $content, $matches)) { if (strpos($matches[1], 'youtube.com') > 0 || strpos($matches[1], 'vimeo.com') > 0) { $data['url'] = $matches[1] . '&width=' . $data['width'] . '&height=' . $data['height']; } else { $arr = array('playlist' => array(array('autoPlay' => $data['auto_play'] == 'Y', 'autoBuffering' => $data['auto_buffer'] == 'Y', 'url' => $matches[1])), 'plugins' => array('controls' => array('url' => OP_MOD_URL . 'blog/video/flowplayer/flowplayer.controls-3.2.5.swf'))); $data['url'] = '#inline-content'; $data['videoUrl'] = $matches[1]; /* * Video URL 1 */ $data['videoUrl1'] = ''; $url1 = base64_decode($atts['url1']); if (preg_match('|(https?://[^<"]+)|im', $url1, $matches)) { $data['videoUrl1'] = $matches[1]; } /* * Video URL 2 */ $data['videoUrl2'] = ''; $url2 = base64_decode($atts['url2']); if (preg_match('|(https?://[^<"]+)|im', $url2, $matches)) { $data['videoUrl2'] = $matches[1]; } } } } //Initialize the output variable $output = op_mod('video')->output(array(), array(), $data, true, true); //Process any additional template variables $data['placeholder_width'] = intval(empty($data['placeholder_width']) ? $output['options']['width'] : $data['placeholder_width']); $data['placeholder_height'] = intval(empty($data['placeholder_height']) ? $output['options']['height'] : $data['placeholder_height']); $data['frame_width'] = $placeholder_width + 18; $data['align'] = $data['align'] == 'center' ? 'margin:0 auto;' : 'float:' . $data['align']; if (!is_admin()) { unset($output['options']['placeholder']); extract($output['options']); $data['video_type'] = ' video-type-' . $data['type']; } else { //if(count($data) == 0) $data = array('width' => $default['values']['width'], 'height' => $default['values']['height']); if (empty($data['width'])) { $data['width'] = $default['values']['width']; } if (empty($data['height'])) { $data['height'] = $default['values']['height']; } $data['video_type'] = ''; $data['url'] = '#'; $data['inlinecontent'] = ''; } //Clear the template _op_tpl('clear'); //Process the new template and load it return _op_tpl('_load_file', OP_ASSETS . 'tpls/video_lightbox/style_' . $data['style'] . '.php', $data, true); }
function _generate_tabs($conf = array(), $tabs, $field_name, $field_ext = '', $page_id = 0, $page_id2 = 0, $idx = 0) { _op_tpl('clear'); op_tpl_assign(array('config' => $conf, 'page_id' => $page_id, 'page_id2' => $page_id2, 'field_name' => $field_name, 'field_ext' => $field_ext, 'index' => $idx, 'add_page_link' => $this->data['add_page_link'])); $tab_content = array(); $counter = 0; foreach ($tabs as $name => $title) { $tab_data = array(); if ($name == 'page_setup') { $tab_data['landing_select'] = $this->_page_select($page_id); $tab_data['value_select'] = $this->_page_select($page_id2); } elseif ($name == 'page_setup_sales') { $tab_data['sales_select'] = $this->_page_select($page_id); } $tab_content[$name] = op_tpl('launch_suite/pages/' . $name, $tab_data); //Check if this is the first tab content (if it is, this contains the markup we need to filter) if ($counter == 1) { //Create the regex for finding the ID $pattern = '/<div id=\\".*\\" class=\\"sneezing-panda op-content-slider\\"\\>/'; //Init the counter for the number of replacement we are on $replacement_counter = 0; //Search through the content with regex, using callback so we can increment the replacement counter $tab_content[$name] = preg_replace_callback($pattern, create_function('$matches', ' global $replacement_counter; $replacement_counter++; //Return the same string found only this time, increment the id by one return str_replace("\\" class=\\"sneezing-panda op-content-slider\\">", "_".$replacement_counter."\\" class=\\"sneezing-panda op-content-slider\\">", $matches[0]); '), $tab_content[$name]); } $counter++; } return $tab_content; }