Exemplo n.º 1
0
 public function init_options_set()
 {
     if (!is_null($this->get_options_set())) {
         return;
     }
     if (is_string($this->get_template()) and is_file($this->get_template())) {
         $template = (include $this->get_template());
     } else {
         if (is_array($this->get_template())) {
             $template = $this->get_template();
         } else {
             throw new Exception(__('Invalid template supplied', 'wp-ultimate-recipe'), 1);
         }
     }
     $parser = new VP_Option_Parser();
     $set = $parser->parse_array_options($template, $this->use_auto_group_naming());
     $set->set_layout($this->get_layout());
     // assign set object
     $this->set_options_set($set);
     if ($this->use_util_menu()) {
         // setup utility menu
         $util_menu = new VP_Option_Control_Group_Menu();
         $util_menu->set_title(__('Utility', 'wp-ultimate-recipe'));
         $util_menu->set_name('menu_util');
         $util_menu->set_icon('font-awesome:fa-ambulance');
         // setup restore default section
         $restore_section = new VP_Option_Control_Group_Section();
         $restore_section->set_title(__('Restore Default', 'wp-ultimate-recipe'));
         $restore_section->set_name('section_restore');
         // setup restore button
         $restore_button = new VP_Option_Control_Field_Restore();
         $restore_section->add_field($restore_button);
         // setup exim section
         $exim_section = new VP_Option_Control_Group_Section();
         $exim_section->set_title(__('Export/Import', 'wp-ultimate-recipe'));
         $exim_section->set_name('section_exim');
         // setup exim field
         $exim_field = new VP_Option_Control_Field_ImpExp();
         $exim_section->add_field($exim_field);
         // add exim section
         $util_menu->add_control($exim_section);
         $util_menu->add_control($restore_section);
         $set->add_menu($util_menu);
     }
 }
Exemplo n.º 2
0
	public function init_options_set()
	{
		if(!is_null($this->get_options_set()))
			return;

		if( is_string($this->get_template()) and is_file($this->get_template()) )
			$template = include $this->get_template();
                        
		else if(is_array($this->get_template()))
			$template = $this->get_template();
		else
			throw new Exception(__( 'Invalid template supplied', 'vp_textdomain' ), 1);

		$parser = new VP_Option_Parser();
		$set    = $parser->parse_array_options($template, $this->use_auto_group_naming());
		$set->set_layout($this->get_layout());

		// assign set object
		$this->set_options_set($set);

		if( $this->use_util_menu() )
		{
			// setup utility menu
			$util_menu = new VP_Option_Control_Group_Menu();
			$util_menu->set_title(__('Utility', 'vp_textdomain'));
			$util_menu->set_name('menu_util');
			$util_menu->set_icon('font-awesome:fa-ambulance');

			// setup restore default section
			$restore_section = new VP_Option_Control_Group_Section();
			$restore_section->set_title(__('Oneclick Installation', 'charity'));
			$restore_section->set_name('section_restore');
			$restore_section->set_description(__('Here, You Can Import Charity Data Easily In Accordance With Requirement & Install Theme in Just One Click',"charity"));
				

			// setup restore button
			$restore_button = new VP_Option_Control_Field_Restore();
			$restore_section->add_field($restore_button);
			/*???
			// setup exim section
			$exim_section = new VP_Option_Control_Group_Section();
			$exim_section->set_title(__('Export/Import', 'vp_textdomain'));
			$exim_section->set_name('section_exim');

			// setup exim field
			$exim_field = new VP_Option_Control_Field_ImpExp();
			$exim_section->add_field($exim_field);

			// add exim section
			//???$util_menu->add_control($exim_section);
			*/
			//==== Offline installation
			$offline_section = new VP_Option_Control_Group_Section();
			$offline_section->set_title(__('Offline / Manual Installation', 'charity'));
			$offline_section->set_name('section_offline');
			$offline_section->set_description(__('Here, You Can Import Charity Data Easily In Accordance With Requirement & Install Theme in Just One Click',"charity"));
				

			// setup restore button
			$offline_button = new VP_Option_Control_Field_Offline();
			$offline_section->add_field($offline_button);
                        
                        
			$util_menu->add_control($restore_section);
                        
			$util_menu->add_control($offline_section);
                        //=========================================
			$set->add_menu($util_menu);
		}
	}