Changes between Version 19 and Version 20 of DolphinTutorialMyFirstModule


Ignore:
Timestamp:
Oct 16, 2015, 12:54:57 AM (7 years ago)
Author:
AlexT
Comment:

Page and attachments were updated to support Dolphin 7.1 and 7.2 version

Legend:

Unmodified
Added
Removed
Modified
  • DolphinTutorialMyFirstModule

    v19 v20  
    297297        $this->_oTemplate->pageStart(); 
    298298 
    299         echo DesignBoxAdmin (_t('_me_blgg'), 'It works!'); 
     299        echo DesignBoxAdmin (_t('_me_blgg'), 'It works!', '', '', 11); 
    300300         
    301301        $this->_oTemplate->pageCodeAdmin (_t('_me_blgg')); 
     
    307307Also 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. 
    308308 
    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. 
     309Another 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. 
    310310 
    311311To 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. 
     
    451451            $sResult = $mixedResult . $sResult; 
    452452 
    453         echo DesignBoxAdmin (_t('_me_blgg'), $sResult); // dsiplay box 
     453        echo DesignBoxAdmin (_t('_me_blgg'), $sResult, '', '', 11); // dsiplay box 
    454454         
    455455        $this->_oTemplate->pageCodeAdmin (_t('_me_blgg')); // output is completed, admin page will be displaed here 
     
    496496SET @iMax = (SELECT MAX(`order`) FROM `sys_menu_admin` WHERE `parent_id` = '2'); 
    497497INSERT 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); 
    499499}}} 
    500500 
     
    547547    * '''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. 
    548548    * '''My Bloggie by Me''' is the module description. 
    549     * '''modules/me/bloggie/|icon.png''' is a menu icon. This icon must 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. 
    550550    * '''@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. 
    551551 
     
    981981 
    982982You 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  
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.
Fork me on GitHub