Skip to main content

Important notes for pyrocms. pyrocms is a cms built on codeigniter

Important notes for pyrocms and codeigniter
pyrocms is a cms built on codeigniter

PYROCMS NOTES

//is_logged_in()
TO CHECK USER LOGGED IN OR NOT

//$this->current_user->group
out put current user group

//$this->permissions);

//$this->module

SHARE RESOURCES BETWEEN MODELS
$this->load->model('navigation/navigation_m');

/&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&/
/****************************************************************************/
//ACCESSING MODEL FROM ANOTHER MODULE
$this->load->model('mailchimp/mailchimp_m');
$ModelMailChimp = new Mailchimp_m();
echo $ModelMailChimp->thisIsWorking();

//ACCESSING CONTROLLER FROM ANOTHER MODULE CONTROLLER WITHIN ADDONS
$this->load->library('../../mailchimp/controllers/mailchimp');
$mailChipController = new Mailchimp();
echo $mailChipController->loadedFunction();
IMPOTANT : NEED TO COPY ANY LANGUAGE FILE IN THE LANGUAGE FOLDER OF THE LOCAL MODULE

//LOADING CORE MODELS IN system\cms\modules\
$this->load->model('blog/blog_m');
$this->load->model('blog/blog_categories_m');

//LOADING CODE MODEL CONTROLLER
echo $path = FCPATH."system\cms\modules\blog\controllers\blog.php";
require_once($path);
$blogController = new Blog;
IMPORTANT: NEED TO COPY ANY VIEW FILE AND LANGUAGE FILE LOCALLY IN THE MODULE

/****************************************************************************/
//STARTING A PROJECT

INCLUDE  CONSTANTS FILE IN ROUTES.PHP
include_once 'constants.php';
AND USE IT FOR CONSTANTS OF THE SITE

/*****************************************************************************/
//Steps to start a module

1. Setup a module
2. Details .php has information about roles menu in the info variable
3. language files are important.
4. all the views/admin/ folder to work with admin design or theme design of pyrocms
5. roles should be defines as $this->module, $this->controller, $this->method, $this->permission
6. group_has_role('pages', 'put_live');
7. role_or_die('pages', 'edit', 'admin/dashboard', 'Sorry, you can\'t edit pages.')

change Admin_controller.php for access

/********************************************************************************/


//adding menu in admin section
public function admin_menu(&$menu)
{
    $menu['lang:cp:nav_addons'] = array(
        'lang:cp:nav_modules'           => 'admin/addons',
        'lang:global:themes'            => 'admin/addons/themes',
        'lang:global:plugins'           => 'admin/addons/plugins',
        'lang:global:widgets'           => 'admin/addons/widgets',
        'lang:global:field_types'       => 'admin/addons/field-types'
    );
}

in details.php file

// this will place menu in content menu    $menu['Content'] = array(
//add_admin_menu_place('lang:cp:nav_addons', 6); place menu in 6th place


















Comments

Popular posts from this blog

How to upload file in MEAN Stack

How to upload file in MEAN Stack Do these steps 1. npm install ng-file-upload 2. include ng-file-upload.min.js in your angular index .html 3. Use this example to copy form to your angular page from where u want to upload file. -- http://jsfiddle.net/0m29o9k7/ or http://jsfiddle.net/danialfarid/2vq88rfs/136/ Copy this code outside of any form which is already there: 4. Change this url from example code to where you want to upload files -- url: 'https://angular-file-upload-cors-srv.appspot.com/upload', 6. In your server.js or app.js which ever you are using as (node server.js) to start app add these lines     var crypto = require('crypto');         var mime = require('mime');         var multer  = require('multer');                     var storage = multer.diskStorage({           destination: function (req, file, cb) {     ...

Error: ios-deploy was not found. Please download, build and install version 1.9.0 or greater from https://github.com/phonegap/ios-deploy into your path, or do 'npm install -g ios-deploy' solution this solved the issue sudo npm install -g ios-deploy -unsafe-perm

Error: ios-deploy was not found. Please download, build and install version 1.9.0 or greater from https://github.com/phonegap/ios-deploy into your path, or do 'npm install -g ios-deploy' solution this solved the issue sudo npm install -g ios-deploy -unsafe-perm