Biz Connection FREE TRIAL + $75 GOOGLE ADWORD - FREE VOUCHER for YOU!

Foront End Users – CMS Made Simple

Basic data

Like in any modules here there are three types of file

- files where data are extracted from database and assigned to template variables contains files word into their name.

- files which display data are templates files and they are found in templates folder

- files used to execute contain action word in their name

Study case – functionality

To add/change functionality watch the following files (admin area):

a) Files used to display list of users:

function.admin_userstab.php

userlist.tpl (template file)

b) Example: Add a new button in user list (for every single user in the list) and to this button a specific task to be done (on Click).

- create the “link” into the function.admin_userstab.php, like this :

$onerow->MyNewLink =
$this->CreateLink ($id, ‘edituser’, $returnid,
$gCms->variables[MyNewLink']->DisplayImage(‘icons/system/MyNewLink.gif’,
$this->Lang (‘MyNewLink’), ”, ”, ‘systemicon’),
array (‘user_id’ => $row['id'] ));

You should have in LANG files the Lang (‘MyNewLink’) defined

You should have the icons/system/MyNewLink.gif created under admin folder.

- use this link ito your template file

- create a file named action.MyNewLink.php and here write your code to be executedwhen your button will be clicked.

c) enable in FrontEndUsers.module.php the action (see around line #1000) and add before  parent::DoAction($action,$id,$params,$returnid);

the following  line: case ‘MyNewLink‘:

It will enable execution of your action file.

Notes:

all above is happening under folder of FEU module

avoid capitalisation in file name and variables, it is not compolsory but you may avoid headache.

Random article

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Leave a Comment