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

Send push motification to iphone and android code

Send push motification to iphone and android code function sendIphoneAdminPush($token,$message) { $streamContext = stream_context_create(); $badge = 0; //$message = "Here is the new deal having 50% discount for business ABC."; //$token = "ghjkghkgkghkghkjghkghkghjkhkghkghjkhkhgjkhgj"; stream_context_set_option($streamContext, 'ssl', 'local_cert', $_SERVER['DOCUMENT_ROOT'].'/nodatapp/pem/pushNew.pem'); $apns = stream_socket_client( //'ssl://gateway.sandbox.push.apple.com:2195', 'ssl://gateway.push.apple.com:2195', $error, $errorString, 60, STREAM_CLIENT_CONNECT, $streamContext); $load = array(   'aps' => array(   'alert' => $message,   'badge' => $badge,   'sound' => 'default',   'data' => array( 'push_type' => "IphonePush" )   )   ); $payloa...

angular2-color-picker TypeError: Cannot read property 'substr' of undefined - source-node.js

angular2-color-picker TypeError: Cannot read property 'substr' of undefined - source-node.js if you install npm i --save angular2-color-picker and get node error  TypeError: Cannot read property 'substr' of undefined - source-node.js TypeError : Cannot read property 'substr' of undefined at Function .< anonymous > ( E : \Documents\Year_3\Mobile_Application_Development\mammoth - v2\node_modules\webpack - sources\node_modules\source - map\lib\source - node . js : 95 : 30 ) at Array . forEach ( native ) at BasicSourceMapConsumer . SourceMapConsumer_eachMapping [ as eachMapping ] ( E : \Documents\Year_3\Mobile_Application_Development\mammoth - v2\node_modules\webpack - sources\node_modules\source - map\lib\source - map - consumer . js : 155 : 14 ) at Function . SourceNode_fromStringWithSourceMap [ as fromStringWithSourceMap ] ( E : \Documents\Year_3\Mobile_Application_Development\mammoth - v2\node_mod...

If location on IOS do not work with geolocation

If location on IOS do not work with geolocation iOS Quirks Since iOS 10 it's mandatory to add a NSLocationWhenInUseUsageDescription entry in the info.plist. NSLocationWhenInUseUsageDescription describes the reason that the app accesses the user's location. When the system prompts the user to allow access, this string is displayed as part of the dialog box. To add this entry you can pass the variable GEOLOCATION_USAGE_DESCRIPTION on plugin install. Example: cordova plugin add cordova-plugin-geolocation --variable GEOLOCATION_USAGE_DESCRIPTION="your usage message" If you don't pass the variable, the plugin will add an empty string as value. To solve your problem, try: Uninstall the plugin: cordova plugin remove cordova-plugin-geolocation Reinstall with: cordova plugin add cordova-plugin-geolocation --variable GEOLOCATION_USAGE_DESCRIPTION= "my_project would like to use your location" platform/ios/{project}/{project}...