Changes between Version 19 and Version 20 of DolphinTutorialMyFirstModule
- Timestamp:
- Oct 16, 2015, 12:54:57 AM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DolphinTutorialMyFirstModule
v19 v20 297 297 $this->_oTemplate->pageStart(); 298 298 299 echo DesignBoxAdmin (_t('_me_blgg'), 'It works!' );299 echo DesignBoxAdmin (_t('_me_blgg'), 'It works!', '', '', 11); 300 300 301 301 $this->_oTemplate->pageCodeAdmin (_t('_me_blgg')); … … 307 307 Also the difference in the code is that we check if admin only can access this page. The '''$GLOBALS!['logged']!['admin']''' variable is set to true if admin is logged in. Additionally, you can check if regular members are logged in by using the '''$GLOBALS!['logged']!['member']''' variable. If none of these values are true, then a guest is accessing your page. The '''displayAccessDenied''' function displays a page with an "access denied" message - in this case, we don't need to care much about that, and we can just return from the function or even exit. The '''$GLOBALS!['logged']''' does not always exist, and is initialized in the '''check_logged''' function. In our case this function is called in the '''bloggie/request.php''' file. 308 308 309 Another new function here is '''!DesignBoxAdmin'''. It wraps our content in a nice box. The box title is the first parameter and box content is the second one. There is an optional 3rd parameter where you can define the box menu. Also, there is an analog of this function in the user side called '''!DesignBoxContent'''. You can examine existing Dolphin code for a lot of examples.309 Another new function here is '''!DesignBoxAdmin'''. It wraps our content in a nice box. The box title is the first parameter and box content is the second one. There is an optional 3rd and 4th parameters where you can define the box menu and bottom bar. 5th parameter is design box type, 1 - no padding, 11 - box with padding. Also, there is an analog of this function in the user side called '''!DesignBoxContent'''. You can examine existing Dolphin code for a lot of examples. 310 310 311 311 To test the page, you need to login to the admin panel and open the '''http://www.your-site.com/your-path/m/bloggie/administration''' URL. … … 451 451 $sResult = $mixedResult . $sResult; 452 452 453 echo DesignBoxAdmin (_t('_me_blgg'), $sResult ); // dsiplay box453 echo DesignBoxAdmin (_t('_me_blgg'), $sResult, '', '', 11); // dsiplay box 454 454 455 455 $this->_oTemplate->pageCodeAdmin (_t('_me_blgg')); // output is completed, admin page will be displaed here … … 496 496 SET @iMax = (SELECT MAX(`order`) FROM `sys_menu_admin` WHERE `parent_id` = '2'); 497 497 INSERT IGNORE INTO `sys_menu_admin` (`parent_id`, `name`, `title`, `url`, `description`, `icon`, `order`) VALUES 498 (2, 'me_blgg', '_me_blgg', '{siteUrl}modules/?r=bloggie/administration/', 'My Bloggie by Me', ' modules/me/bloggie/|icon.png', @iMax+1);498 (2, 'me_blgg', '_me_blgg', '{siteUrl}modules/?r=bloggie/administration/', 'My Bloggie by Me', 'file', @iMax+1); 499 499 }}} 500 500 … … 547 547 * '''URL''' is specifiled without permalinks enabled, and it is transformed to mod_rewrite URL automatically, if permalinks are enabled. Also, we used '''siteUrl''' in the URL, but it will be replaced with the full site URL with the slash at the end. 548 548 * '''My Bloggie by Me''' is the module description. 549 * ''' modules/me/bloggie/|icon.png''' is a menu icon. This iconmust be placed into the '''modules/me/bloggie/templates/base/images/icons/''' folder and named '''icon.png'''. The size should be 16x16 pixels.549 * '''file''' is a menu icon - FontAwesome icon name without prefix. It can be usual image icon in the format - "modules/me/bloggie/|icon.png", then icon image file must be placed into the '''modules/me/bloggie/templates/base/images/icons/''' folder and named '''icon.png'''. The size should be 16x16 pixels. 550 550 * '''@iMax+1''' is order. Order is calculated in the previous string, and in this case, it will be added to the end of the list - which is preferable behavior. 551 551 … … 981 981 982 982 You probably have many questions or are willing to share your new module or experience with others after reading this post, so use the links above to do it in the right place. 983