public function depedencies_manage_options_template()
 {
     // Derive the current path and load up aaInterfaceTemplates
     $plugin_path = $this->the_plugin->cfg['paths']['freamwork_dir_path'];
     if (class_exists('aaInterfaceTemplates') != true) {
         require_once $plugin_path . 'settings-template.class.php';
         // Initalize the your aaInterfaceTemplates
         $aaInterfaceTemplates = new aaInterfaceTemplates($this->the_plugin->cfg);
         // try to init the interface
         $aaInterfaceTemplates->printBaseInterface('depedencies');
     }
 }
Esempio n. 2
0
        private function buildHtmlPage()
        {
            $req = array('module' => isset($_GET['module']) ? trim($_GET['module']) : '', 'shortcode' => isset($_GET['shortcode']) ? trim($_GET['shortcode']) : '');
            $tryed_module = $this->the_plugin->cfg['modules']["{$req['module']}"];
            if (isset($tryed_module) && count($tryed_module) > 0) {
                // Turn on output buffering
                ob_start();
                // shortcodes options
                $opt_file_path = $tryed_module['folder_path'] . 'options-shortcodes.php';
                if (is_file($opt_file_path)) {
                    require $opt_file_path;
                }
                $options = ob_get_clean();
                //copy current buffer contents into variable and delete current output buffer
                if (trim($options) != "") {
                    $options = json_decode($options, true);
                }
                if (is_array($options) && !empty($options) > 0) {
                    foreach ($options as $option) {
                        foreach ($option as $box_id => $box) {
                            if ($box_id == $req['shortcode']) {
                                $shortcode = $box['shortcode'];
                                $exclude_empty = isset($box['exclude_empty_fields']) && ($box['exclude_empty_fields'] || $box['exclude_empty_fields'] == 'true') ? 'yes' : 'no';
                                $options = array(array("{$box_id}" => $box));
                                break 2;
                            }
                        }
                    }
                }
            }
            //sh_title, sh_code
            $html = '';
            if (!empty($shortcode) && is_array($options) && !empty($options) > 0) {
                // load the settings template class
                require_once $this->the_plugin->cfg['paths']['freamwork_dir_path'] . 'settings-template.class.php';
                // Initalize the your aaInterfaceTemplates
                $aaInterfaceTemplates = new aaInterfaceTemplates($this->the_plugin->cfg);
                // then build the html, and return it as string
                $html = $aaInterfaceTemplates->bildThePage($options, $this->the_plugin->alias, array(), true);
                // fix some URI
                $html = str_replace('{plugin_folder_uri}', $tryed_module['folder_uri'], $html);
            }
            ?>
			<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
			<html xmlns="http://www.w3.org/1999/xhtml">
			<head></head>
			<body>
			
			<script type="text/javascript" src="<?php 
            echo $this->module_folder;
            ?>
js/tinymce.popup.js" ></script>
			<link rel='stylesheet' href='<?php 
            echo $this->module_folder;
            ?>
css/tinymce.popup.css' type='text/css' media='all' />
			<div class="psp-form psp-shortcode-pop-up">
			
				<?php 
            if (!empty($html)) {
                echo $html;
                ?>
				
					<!-- buttons for each box -->
					<div class="psp-button-row">
			
						<?php 
                echo '<input type="reset" value="' . __('Reset to default value', $psp->localizationName) . '" class="psp-button gray left" id="aff-reset-shortcode" />';
                ?>
						<?php 
                echo '<input type="submit" value="' . __('Insert shortcode', $psp->localizationName) . '" class="psp-button green psp-saveOptions" id="aaf-insert-shortcode" />';
                ?>
			
					</div>
					
					<div id="aafShortcodeFormat" style="display:none;"><?php 
                echo $shortcode;
                ?>
</div>
					<div id="aafShortcodeField" style="display:none;"></div>
					<div id="aafShortcodeAtts" style="display:none;" data-exclude_empty="<?php 
                echo $exclude_empty;
                ?>
">
					</div>
				
				<?php 
            } else {
                echo '<div>' . __('Error occured!', $this->the_plugin->localizationName) . '</div>';
            }
            ?>

			</div>

			</body>
			</html>
			<?php 
        }
 public function manage_options_template()
 {
     // Derive the current path and load up aaInterfaceTemplates
     $plugin_path = dirname(__FILE__) . '/';
     if (class_exists('aaInterfaceTemplates') != true) {
         require_once $plugin_path . 'settings-template.class.php';
         // Initalize the your aaInterfaceTemplates
         $aaInterfaceTemplates = new aaInterfaceTemplates($this->cfg);
         // try to init the interface
         $aaInterfaceTemplates->printBaseInterface();
     }
 }
Esempio n. 4
0
        public function custom_metabox()
        {
            global $post;
            $post_id = (int) $post->ID;
            // load the settings template class
            require_once $this->the_plugin->cfg['paths']['freamwork_dir_path'] . 'settings-template.class.php';
            // Initalize the your aaInterfaceTemplates
            $aaInterfaceTemplates = new aaInterfaceTemplates($this->the_plugin->cfg);
            // retrieve the existing value(s) for this meta field. This returns an array
            $locations_meta = get_post_meta($post_id, 'psp_locations_meta', true);
            // then build the html, and return it as string
            $html_business_information = $aaInterfaceTemplates->bildThePage($this->business_information_options($locations_meta), $this->the_plugin->alias, array(), false);
            $html_business_contact = $aaInterfaceTemplates->bildThePage($this->business_contact_options($locations_meta), $this->the_plugin->alias, array(), false);
            $html_opening_hours = $aaInterfaceTemplates->bildThePage($this->opening_hours_options($locations_meta), $this->the_plugin->alias, array(), false);
            $html_other_details = $aaInterfaceTemplates->bildThePage($this->other_details_options($locations_meta), $this->the_plugin->alias, array(), false);
            ?>
			<link rel='stylesheet' href='<?php 
            echo $this->module_folder;
            ?>
app.css' type='text/css' media='screen' />
			<?php 
            /*<link rel='stylesheet' href='<?php echo $this->module_folder;?>jquery-ui-1.10.3.custom.min.css' type='text/css' media='screen' />
            		<script type="text/javascript" src="<?php echo $this->module_folder;?>jquery-ui-1.10.3.custom.min.js"></script>*/
            ?>
			<script type="text/javascript" src="<?php 
            echo $this->module_folder;
            ?>
app.class.js" ></script>
			
			<div id="psp-meta-box-preload" style="height:200px; position: relative;">
				<!-- Main loading box -->
				<div id="psp-main-loading" style="display:block;">
					<div id="psp-loading-box" style="top: 50px">
						<div class="psp-loading-text"><?php 
            _e('Loading', $this->the_plugin->localizationName);
            ?>
</div>
						<div class="psp-meter psp-animate" style="width:86%; margin: 34px 0px 0px 7%;"><span style="width:100%"></span></div>
					</div>
				</div>
			</div>
			
			<div id="psp-meta-box-container" style="display:none;">
				<!-- box Tab Menu -->
				<div class="psp-tab-menu">
					<a href="#business_information" class="open"><?php 
            _e('Business Information', $this->the_plugin->localizationName);
            ?>
</a>
					<a href="#business_contact"><?php 
            _e('Business Contact and Google Map', $this->the_plugin->localizationName);
            ?>
</a>
					<a href="#opening_hours"><?php 
            _e('Opening Hours', $this->the_plugin->localizationName);
            ?>
</a>
					<a href="#other_details"><?php 
            _e('Other details', $this->the_plugin->localizationName);
            ?>
</a>
				</div>
				
				<div class="psp-tab-container">

					<div id="psp-tab-div-id-business_information" style="display:block;">
						<div class="psp-dashboard-box span_3_of_3">
							<!-- Creating the option fields -->
							<div class="psp-form">
								<?php 
            echo $html_business_information;
            ?>
							</div>
						</div>
					</div>
					
					<div id="psp-tab-div-id-business_contact" style="display:none;">
						<div class="psp-dashboard-box span_3_of_3">
							<!-- Creating the option fields -->
							<div class="psp-form">
								<?php 
            echo $html_business_contact;
            ?>
							</div>
						</div>
					</div>
					
					<div id="psp-tab-div-id-opening_hours" style="display:none;">
						<div class="psp-dashboard-box span_3_of_3">
							<!-- Creating the option fields -->
							<div class="psp-form">
								<?php 
            echo $html_opening_hours;
            ?>
							</div>
						</div>
					</div>
					
					<div id="psp-tab-div-id-other_details" style="display:none;">
						<div class="psp-dashboard-box span_3_of_3">
							<!-- Creating the option fields -->
							<div class="psp-form">
								<?php 
            echo $html_other_details;
            ?>
							</div>
						</div>
					</div>
					
				</div>
				<div style="clear:both"></div>
			</div>
		<?php 
        }