/**
  *
  * Multiple Options Rendering..
  *
  * @since 1.0.0
  * @author Andrew Powers
  *
  */
 function _get_multi_option($oid, $o)
 {
     global $post_ID;
     $sub_option_engine = new OptEngine($this->settings_field);
     $flag = $this->settings_field == 'meta' ? $post_ID : null;
     echo '<div class="multi_option">';
     foreach ($o['selectvalues'] as $mid => $m) {
         // Needed for saving on special pages
         if (isset($o['special'])) {
             $m['special'] = $o['special'];
         }
         // Flag needed for post id/profile id -- settings for special handling.
         $sub_option_engine->option_engine($mid, $m, $flag, $this->settings_field);
     }
     echo '</div>';
 }
    /**
     *
     * @TODO document
     *
     */
    function posts_metapanel($type, $mode = 'meta')
    {
        $option_engine = new OptEngine(PAGELINES_SPECIAL);
        $handle = 'postsTabs' . $type;
        // Zero Out Tabs
        $this->tabs = array();
        do_global_meta_options($mode);
        $special_template = new PageLinesTemplate($type);
        $special_template->load_section_optionator($mode, $type);
        ob_start();
        ?>

	<script type="text/javascript">
		jQuery(document).ready(function() {
			<?php 
        printf('var %1$s = jQuery("#%1$s").tabs({cookie: {  name: "htabs-%2$s" }, fx: { opacity: "toggle", duration: 150 }});', $handle, $type);
        ?>
		});
	</script>

		<div id="<?php 
        echo $handle;
        ?>
" class="plist-nav fix">


			<ul class="fix plist">
				<?php 
        if (count($this->tabs) != 1) {
            ?>
					<lh class="hlist-header">Select Settings Panel</lh>
					<?php 
            foreach ($this->tabs as $tab => $t) {
                ?>
						<li>
							<a class="<?php 
                echo $tab;
                ?>
  metapanel-tab <?php 
                if (!$t->active && $type != 'default') {
                    echo 'inactive-tab';
                }
                ?>
" href="#<?php 
                echo $tab;
                ?>
">
								<span class="metatab_pad fix">
									<span class="metatab_icon" style="background: transparent url(<?php 
                echo $t->icon;
                ?>
) no-repeat 0 0;display: block;">
										<?php 
                if (!$t->active && $type != 'default') {
                    printf('<span class="tab_inactive">inactive</span>');
                }
                echo substr($t->name, 0, 17);
                ?>
									</span>
								</span>
							</a>
						</li>
					<?php 
            }
            ?>
				<?php 
        } else {
            ?>
					<lh class="hlist-header"><?php 
            echo ucfirst($mode);
            ?>
 Settings</lh>
				<?php 
        }
        ?>
			</ul>

			<?php 
        foreach ($this->tabs as $tab => $t) {
            ?>
				<div id="<?php 
            echo $tab;
            ?>
" class="posts_tab_content">
					<div class="posts_tab_content_pad">
						<div class="metatab_title" style="background: url(<?php 
            echo $t->icon;
            ?>
) no-repeat 10px 13px;" >
							<?php 
            echo $t->name;
            if (!$t->active && $type != 'default') {
                echo OptEngine::superlink(__('Inactive On Template', 'pagelines'), 'black', 'right', admin_url('admin.php?page=pagelines_templates'));
            } elseif ($type == 'default') {
                echo OptEngine::superlink(__('Sitewide Defaults', 'pagelines'), null, 'right');
            }
            ?>
						</div>
						<?php 
            foreach ($t->options as $oid => $o) {
                $o['special'] = $type;
                $o['scontrol'] = $mode;
                $o['clone_id'] = isset($t->clone_id) ? $t->clone_id : 1;
                $option_engine->option_engine($oid, $o);
            }
            ?>
					</div>
				</div>

			<?php 
        }
        ?>
		</div>
		<?php 
        return ob_get_clean();
    }
    /**
     * Option Interface Body, including vertical tabbed nav
     *
     */
    function build_body()
    {
        $option_engine = new OptEngine($this->set['settings']);
        global $pl_section_factory;
        $tabs = $this->set['tabs'] ? true : false;
        ?>
			<div id="tabs" class="<?php 
        if (!$tabs) {
            echo 'no_tabs';
        }
        ?>
">

				<?php 
        if ($tabs) {
            ?>
				<ul id="tabsnav">
					<li><span class="graphic top">&nbsp;</span></li>
					<?php 
            foreach ($this->option_array as $menu => $oids) {
                $pro_tab = !VPRO && isset($oids['version']) && $oids['version'] == 'pro' ? true : false;
                $bg = isset($oids['icon']) ? sprintf('style="background: transparent url(%s) no-repeat 0 0;"', $oids['icon']) : '';
                $name = $pro_tab ? sprintf('%s <span class="sss-tag">(Pro)</span>', ui_key($menu)) : ui_key($menu);
                $special_class = $pro_tab ? 'pro_tab' : '';
                printf('<li><a class="%1$s tabnav-element %4$s" href="#%1$s"><span class="icn" %3$s >%2$s</span></a></li>', $menu, $name, $bg, $special_class);
            }
            ?>
					<li><span class="graphic bottom">&nbsp;</span></li>

					<li class="framework_loading">
						<a href="http://www.pagelines.com/forum/discussion/6489" target="_blank" title="Javascript Issue Detector">
							<span class="framework_loading_gif" >&nbsp;</span>
						</a>
					</li>
					<script type="text/javascript">/*<![CDATA[*/ jQuery(document).ready(function(){ jQuery('.framework_loading').hide(); }); /*]]>*/</script>
				</ul>
				<?php 
        }
        ?>
				<div id="thetabs" class="plpanel <?php 
        echo $this->set['settings'];
        ?>
-panel fix">
<?php 
        if (!VPRO) {
            $this->get_pro_call();
        }
        foreach ($this->option_array as $menu => $oids) {
            $pro_tab = !VPRO && isset($oids['version']) && $oids['version'] == 'pro' ? true : false;
            $bg = isset($oids['icon']) ? sprintf('style="background: transparent url(%s) no-repeat 10px 16px;"', $oids['icon']) : '';
            $is_htabs = isset($oids['htabs']) ? true : false;
            // The tab container start....
            printf('<div id="%s" class="tabinfo %s">', $menu, $is_htabs ? 'htabs-interface' : '');
            // Draw Menu Title w/ Icon
            if (stripos($menu, '_') !== 0) {
                printf('<div class="tabtitle" %s><div class="tabtitle-pad">%s</div></div>', $bg, ui_key($menu));
            }
            // Render Options
            if (isset($oids['htabs'])) {
                OptEngine::get_horizontal_nav($menu, $oids);
            } elseif ($pro_tab) {
                echo $this->show_banner(sprintf('The pro or dev version is needed for "%s" meta options.<br/> Please use "Blog Page" options instead.', ui_key($menu)), 'http://www.pagelines.com/pricing', 'Upgrade &raquo;');
            } elseif (isset($oids['metapanel'])) {
                echo $oids['metapanel'];
            } else {
                foreach ($oids as $oid => $o) {
                    if ($oid != 'icon') {
                        $option_engine->option_engine($oid, $o);
                    }
                }
            }
            echo '<div class="clear"></div></div>';
        }
        ?>
				</div>
			</div>
<?php 
    }
예제 #4
0
 /**
  *
  * @TODO document
  *
  */
 function load_engine($type, $opts, $post_ID = null, $user = null)
 {
     $option_engine = new OptEngine($type);
     $flag = $type == 'meta' ? $post_ID : $user;
     foreach ($opts as $oid => $o) {
         $option_engine->option_engine($oid, $o, $flag);
     }
 }