Example #1
0
	/**
	 * Contructor
	 *
	 * @access	public
	 * @return	null
	 */
    
	function Freeform_updater_base( )
    {
		if ( isset($GLOBALS['CI']) && get_class($GLOBALS['CI']) == 'Wizard')
    	{
    		return;
    	}

    	parent::Module_builder_bridge('freeform');
    	
		/** --------------------------------------------
        /**  Module Actions
        /** --------------------------------------------*/
        
        $this->module_actions = array(
			'insert_new_entry', 
			'retrieve_entries', 
			'delete_freeform_notification'
		);
    }
Example #2
0
	/**
	 * Constructor
	 *
	 * @access	public
	 * @return	null
	 */
	 
	function Freeform()
	{	
		parent::Module_builder_bridge('freeform');
		
		//load helpers for everything
		ee()->load->helper(array('text', 'form', 'url', 'security', 'string'));
        ee()->load->library('email');

        // -------------------------------------
		//  Module Installed and Up to Date?
		// -------------------------------------
				
		if ($this->database_version() == FALSE OR 
			$this->version_compare($this->database_version(), '<', FREEFORM_VERSION))
		{
			$this->disabled = TRUE;
			
			trigger_error(ee()->lang->line('freeform_module_disabled'), E_USER_NOTICE);
		}
		
		//get module preferences
		$this->prefs = $this->data->get_prefs();
	}
Example #3
0
	/**
	 * Constructor
	 *
	 * @access	public
	 * @param	(bool)		Enable calling of methods based on URI string
	 * @return	(string)
	 */
    
	function Freeform_cp_base( $switch = TRUE )
    {    	
        parent::Module_builder_bridge('freeform');
        
        if ((bool) $switch === FALSE) return; // Install or Uninstall Request
        
		//load helpers for everything
		ee()->load->helper(array('text', 'form'));

		//---------------------------------------------
        //  Module Menu Items
        //---------------------------------------------
        
        $menu	= array(										
			'module_entries'		=> array(	
				'link'  => $this->base . '&method=manage_entries',
				'title' => ee()->lang->line('entries')
			),
			'module_fields'			=> array(	
				'link'  => $this->base . '&method=manage_fields',
				'title' => ee()->lang->line('fields')
			),
			'module_templates'		=> array(	
				'link'  => $this->base . '&method=manage_templates',
				'title' => ee()->lang->line('templates')
			),
			'module_preferences'	=> array(	
				'link'  => $this->base . '&method=module_preferences',
				'title' => ee()->lang->line('preferences')
			),
			'module_documentation'	=> array(	
				'link'  => FREEFORM_DOCS_URL,
				'title' => ee()->lang->line('documentation').
						   '&nbsp;(<span style="font-size:11px">v.' . FREEFORM_VERSION . '</span>)'
			)
		);
        
        $this->cached_vars['module_menu'] 			= $menu;

		$this->cached_vars['js_magic_checkboxes']	= $this->js_magic_checkboxes();

		//--------------------------------------
		//  Module Installed and What Version?
		//--------------------------------------
			
		if ($this->database_version() == FALSE)
		{
			return;
		}
		elseif($this->version_compare($this->database_version(), '<', FREEFORM_VERSION))
		{
			if (APP_VER < 2.0)
			{
				if ($this->freeform_module_update() === FALSE)
				{
					return;
				}
			}
			else
			{
				// For EE 2.x, we need to redirect the request to Update Routine
				$_GET['method'] = 'freeform_module_update';
			}
		}
		else
		{
			//no updates needed? get prefs from new table
			$this->prefs = $this->data->get_prefs();
		}
        
        //--------------------------------------
		//  Request and View Builder
		//--------------------------------------
        
        if (APP_VER < 2.0 && $switch !== FALSE)
        {	
        	if (ee()->input->get('method') === FALSE)
        	{
        		$this->manage_entries();
        	}
        	elseif( ! method_exists($this, ee()->input->get('method')))
        	{
        		$this->add_crumb(ee()->lang->line('invalid_request'));
        		$this->cached_vars['error_message'] = ee()->lang->line('invalid_request');
        		
        		return $this->ee_cp_view('error_page.html');
        	}
        	else
        	{
        		$this->{ee()->input->get('method')}();
        	}
        }

    }