Welcome Guest, Not a member yet? Register   Sign In
BackendPro 0.6.1

[eluser]shinokada[/eluser]
Request for the next version

I am putting more than one website in one db. Each time I have to change prefix be_ in all the files.

It will be nice if we can set prefix during installtion so that we can install more than one Bep.

[eluser]desgraci[/eluser]
[quote author="adamp1" date="1290092730"]@ReyPM: This means you are trying to access a property on an object which is null. In this case it seems the client model hasn't been loaded. Also your file structure is wrong it should be
Code:
modules
  clientes
    controllers
    models
    views

@desgraci: Please read through my blog post on upgrading to php 5 http://www.kaydoo.co.uk/2010/04/patch-ba...with-php-5[/quote]

Dear Mr. Author, cna you put this on the official documentation, it's very simple and i think it will help people from asking, also, i'm going to make the steps, but he problem i had was this one:


BackendPro Installation Process


PHP Error Message

Warning: is_writable() [function.is-writable]: open_basedir restriction in effect. File(/usr/local/apache/htdocs/install) is not within the allowed path(s): (/home/:/usr/lib/php:/tmp) in /home/a7525442/public_html/install/common/CommonFunctions.php on line 18

Free Web Hosting
Before you can install BackendPro please make sure the following folder is writable, then re-run this install:

/usr/local/apache/htdocs/install

Top
This site is powered by BackendPro 0.6
© Copyright 2009 - Adam Price - All rights Reserved

I get that using the debugger mode of www.000webhost.com at www.desgraci.co.cc, none of the errors you mentioned in your post appears, maybe i'm doing a very stupid simple thing wrong, am i right, or should i go around with the blog instructions?

[eluser]shinokada[/eluser]
Re: How to pass $data to container in Admin_Controller or how to make BeP menu dynamic

Current version of admin menu is static.

I want to create a dynamic menu in the Admin menu.

However I am not sure how to pass $data to contaier.

Generally I do like this in a controller to send $data for a view.
$this->load->view($this->_container,$data);

In Admin_Controller to set container,

// Set container variable
$this->_container = $this->config->item('backendpro_template_admin') . "container.php";

Is there anyway to pass $data so that I can add the following code to system/application/views/admin/menu.php?

Code:
...
if($centres){
                foreach($centres as $key => $list){
                echo "<li>";
                echo anchor("mycentre/admin/$key",$list,array('class'=>'icon_house'));
                echo "</li>";
                }
            }

[eluser]adamp1[/eluser]
@shinokada: This feature to allow you to specify the prefix is planned for 1.0

To pass other values to the view why not try:
Code:
$this->load->vars($array)

@desgraci: I will take note of this and make sure it gets into the new doc.

[eluser]shinokada[/eluser]
Thanks Adam.

[eluser]adamp1[/eluser]
If anyone is interested I have finally got round to uploading the base 1.0 code for people to snoop around. Its in the SVN here http://www.assembla.com/code/backendpro/...odes/trunk

Please read the README.txt file if you want to give it ago. Please also note that this code is far from complete. I have got a lot of the base code complete but the GUI is not nearly done.

THIS CODE SHOULD NOT BE USED FOR ANYTHING OTHER THAN REFERENCE AND FUN

Watch this space.

[eluser]desgraci[/eluser]
Thanks!

[eluser]broswilli[/eluser]
Backendpro is a powerful software for Codeigniter i have started using it and it has really cut down development time. The only difficulty i have experienced with it is the Validation library it doesn't work like its parent form_validation and using the form validation library itself the function validation_errors doesn't return the required validation errors. Please i would be gratefull if these questions are answered because i hope to create a screen cast on Backendpro and Codeigniter

[eluser]Unknown[/eluser]
Hi,

i've update the BackendPro a bit and add a function to create the backend navigation via a xml file...


This helper search "module.xml" in the modules directory and list then the definied menu entries...

it add automatically the menu entries to the definied categories...

You must only add the defined resource to your system to see the entry Wink

I have modified the menu template to my own design...
if you use another style, you must modify the menu template.

Have fun Smile

Now the code.


1. Create a new helper
/system/application/helpers/backendmenu_helper.php

Code:
&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Backend Menu Helper
*
* Create dynamic Backend Navigation
*
* @package         TutorialsMS
* @subpackage      Helpers
* @author          Marcus Reinhardt
* @copyright       Copyright (c) 2010
* @link            http://www.tutorialms.com
* @filesource
*/

function getBackendNavigation()
{

    //get xml files from modules directory

    $CI         = & get_instance();
    $CI->load->library('parser');
    $xmlFiles   = getModulesConfigXml(FCPATH."modules");
    $menu['menu']       = Array();

    foreach($xmlFiles as $file)
    {
        
        $xmlObject              = simplexml_load_file($file);
        $data                   = xml2array($xmlObject);

        foreach ($data['navigation'] as $items)
        {
            
            if(isset($items['name']))
            {
                $menu['menu'][$data['category']][] = array(

                    'name'      => $items['name'],
                    'path'      => $items['path'],
                    'resource'  => $items['resource']

                );
            }
            else
            {
                foreach($items as $item)
                {
                  
                    $menu['menu'][$data['category']][] = array(

                        'name'      => $item['name'],
                        'path'      => $item['path'],
                        'resource'  => $item['resource']

                    );

                }


            }

        }
    }

//   echo "<pre>";
//   var_dump($menu);
//   echo "</pre>";

   return $CI->load->view($CI->config->item('backendpro_template_admin') . 'menu', $menu);

}


/*
* Source: http://xhtmlforum.de/355604-post7.html
*/

function xml2array($xml)
{
    $xmlArray = array();
    if(is_object($xml))
    {
        settype($xml,'array') ;
    }
    foreach ($xml as $key=>$value)
    {
        if(is_array($value) || is_object($value))
        {
            $xmlArray[$key] = xml2array($value);
            
        }
        else
        {  
            $xmlArray[$key] = $value;
        }
        
    }

    return $xmlArray;
}

//load xml files from modules
function getModulesConfigXml($root_dir, $all_data=array())
{
    // only include files with these extensions
    $allow_extensions = array("xml");
    // make any specific files you wish to be excluded
    $ignore_files = array();
    $ignore_regex = '/^_/';
    // skip these directories
    $ignore_dirs = array(".", "..", "controllers", "models", "helpers", "config", "views", "language", "libraries");

    // run through content of root directory
    $dir_content = scandir($root_dir);
    foreach($dir_content as $key => $content)
    {
      $path = $root_dir.'/'.$content;
      if(is_file($path) && is_readable($path))
      {
        // skip ignored files
        if(!in_array($content, $ignore_files))
        {
          if (preg_match($ignore_regex,$content) == 0)
          {
            $content_chunks = explode(".",$content);
            $ext = $content_chunks[count($content_chunks) - 1];
            // only include files with desired extensions
            if (in_array($ext, $allow_extensions))
            {
                // save file name with path
                $all_data[] = $path;
            }
          }
        }
      }
      // if content is a directory and readable, add path and name
      elseif(is_dir($path) && is_readable($path))
      {
        // skip any ignored dirs
        if(!in_array($content, $ignore_dirs))
        {
          // recursive callback to open new directory
          $all_data = getModulesConfigXml($path, $all_data);
        }
      }
    } // end foreach
    return $all_data;
} // end get_files()


2. Update the menu template
/system/application/views/admin/menu.php
Code:
<ul id="menu">
<li class="menu_link">&lt;?php print anchor('admin',$this->lang->line('backendpro_dashboard'))?&gt;</li>


&lt;?php foreach($menu as $items => $entries): ?&gt;

    &lt;?php if(check($items,NULL,FALSE)):?&gt;
    <li id="menu_&lt;?php echo $items;?&gt;"><b>&lt;?php echo $items;?&gt;</b>

        <ul>
            &lt;?php foreach($entries as $entry): ?&gt;

               &lt;?php if(check($entry['resource'],NULL,FALSE)):?&gt;<li class="menu_link">&lt;?php print anchor($entry['path'], $entry['name']); ?&gt;</li>&lt;?php endif; ?&gt;

            &lt;?php endforeach; ?&gt;
        </ul>

    </li>
    &lt;?php endif; ?&gt;

&lt;?php  endforeach;?&gt;

</ul>

3. Add the following code in
/system/application/libraries/Admin_Controller.php

Code:
$this->load->helper('backendmenu');


4. Create a new xml file in your module directory
/modules/<module_name>/module.xml

Code:
&lt;?xml version="1.0" encoding="UTF-8"?&gt;


<module>

    <modulename>auth</modulename>
    <category>System</category>
    <navigation>
                  
        <item>
            <name>Access Control</name>
            <path>auth/admin/access_control</path>
            <resource>Access Control</resource>
        </item>
        
        <item>
            <name>Members</name>
            <path>auth/admin/members</path>
            <resource>Members</resource>
        </item>
            

    </navigation>

</module>

[eluser]Unknown[/eluser]
[quote author="broswilli" date="1291387926"]Backendpro is a powerful software for Codeigniter i have started using it and it has really cut down development time. The only difficulty i have experienced with it is the Validation library it doesn't work like its parent form_validation and using the form validation library itself the function validation_errors doesn't return the required validation errors. Please i would be gratefull if these questions are answered because i hope to create a screen cast on Backendpro and Codeigniter[/quote]

Hi !

I had the same problem with validation_errors() and BEP. It seems that BEP updated the Loader library to support modules, but CI 1.7 changed its way to load helpers so it broke form_validation. Here is a patch for system/libraries/Loader.php to make it work again :

line 980 :
after
Code:
$this->_ci_classes[] = $subclass;
add these lines
Code:
// Make it compatible with CI 1.7
$this->_ci_classes[strtolower($subclass)] = strtolower($subclass);
// end

line 1005 :
after
Code:
$this->_ci_classes[] = $class;
add
Code:
// Make it compatible with CI 1.7
$this->_ci_classes[strtolower($class)] = strtolower($class);
// end

I have almost no experience with CI, so there may be a much cleaner way to solve this.
Maybe Adam can provide an official fix and call it BEP 0.6.2 ?




Theme © iAndrew 2016 - Forum software by © MyBB