Provides an interface for submitting comments to a page.
| DLComments | Provides an interface for submitting comments to a page. |
| Author | Duc Tri Le <cmsmadesimple---at---email.tiger-inc.com> |
| License | This class is released under the GNU General Public License. |
| Changelog | |
| Data | |
| $get_groups | A boolean specifiying whether or not we should connect to the database to retrieve the current list of comment groups or use what is in the cache. |
| Class Construction | |
| __construct | Create a new instance of DLComments. |
| Override Methods | |
| Module Specific | |
| GetCommentsGroups | Retrieve all the comment groups currently in the database. |
| GetCommentsListing | Retrieve various information regarding the listing of the comments. |
| GetIcon | A wrapper function for calling “DLSupport::GetIcon” since the majority of the icon retrieval will be on the same size. |
| GetIconFrontend | Retrieve the icon for the frontend. |
| GetSettingsHTML | Retrieve the HTML for the settings page. |
| GetStoredTemplates | Retrieve HTML for the listing of the templates. |
| IncludeAdmin | Retrieve the HTML for including required JavaScript and CSS on an admin page. |
| IncludeFrontend | Retrieve the HTML for including required JavaScript and CSS on a regular page. |
| ShowFilterArea | Retrieve the HTML for the filter area on the backend. |
| ShowFrontendCSS | Retrieve the HTML for the frontend CSS inclusion. |
| ShowListingArea | Retrieve the HTML for the listing area on the backend. |
| ShowSettingsArea | Retrieve the HTML for the settings area on the backend. |
| ShowSubmissionForm | Retrieve the HTML for the submission form on the frontend. |
| ShowTemplateArea | Retrieve the HTML for the template area. |
| ShowUserComments | Retrieve the HTML for the user comments. |
| Upgrades and Degrades | |
| Degrade | Undo any upgrades that has been made. |
| AllowAutoInstall | Whether or not an auto install is allowed. |
| AllowAutoUpgrade | Whether or not an auto upgrade is allowed. |
| GetAbout | Get about information. |
| GetAdminSection | Get the admin section this module belongs to. |
| GetAuthor | Get the author. |
| GetAuthorEmail | Get the author e-mail address. |
| GetChangeLog | Get the changelog. |
| GetDependencies | Get other modules depended by this module. |
| GetDescription | Get a description of module. |
| GetFriendlyName | Get module friendly name. |
| GetHelp | Get help information. |
| GetName | Get module name. |
| GetParameters | Get parameters. |
| GetVersion | Get version number of module. |
| HasAdmin | Whether or not module has admin panel. |
| InstallPostMessage | Message to be displayed after installation. |
| IsPluginModule | Whether or not this is a plugin module. |
| MinimumCMSVersion | Minimum CMS version to run this module. |
| UninstallPostMessage | Message to be displayed after uninstall. |
| UninstallPreMessage | Message to be alerted before uninstall. |
| VisibileToAdminUser | Privilege checking. |
protected function GetCommentsGroups( $htmlentities = FALSE )
Retrieve all the comment groups currently in the database. This will try to retrieve the information from cache to prevent many connections to the database. If you need to force this to read from the database, be sure to set the member data $get_groups to TRUE.
| $htmlentities | (boolean) Optional and defaults to FALSE. If this is set to TRUE, then the comment groups value will be passed through the function “htmlentities”, otherwise, it won’t. |
(array) An array containing all of the comment groups.
protected function GetCommentsListing( $id, $returnid, $params )
Retrieve various information regarding the listing of the comments.
| $id | (numeric) The ID given to this module upon execution. |
| $returnid | (string) The ID of the page to return to when the required action is completed. An empty string means that it is just an internal page on the admin site whereas any numeric number is the ID of a frontend page. |
| $params | (array) An array containing various user inputs. |
(array) An array containing the various results generated by this method.
protected function GetIcon( $icon, $alt = '', $size = 32 )
A wrapper function for calling “DLSupport::GetIcon” since the majority of the icon retrieval will be on the same size.
| $icon | (string) The filename of the icon to get without its file extension. Note that not all icons exist. Be sure to check that they exist first. |
| $alt | (string) Optional and defaults to an empty string. The text to be placed in the “alt” attribute of the IMG tag. If it is not given or empty, it will use the $icon value with underscores converted to whitespace and the first letter of each word would be capitalize. |
| $size | (int) Optional and defaults to 32. This is the dimension of the icon. Note that not all dimensions exist. Be sure to check that the dimension folder you are requesting exist. |
(string) The HTML for the IMG tag with appropriate information for displaying the icon.
protected function GetIconFrontend( $icon, $alt )
Retrieve the icon for the frontend. If there is a preference with a value for the given $icon, then this will use that. Otherwise, it will use the default icon from DLSupport.
| $icon | (string) The icon to retrieve. |
| $alt | (string) The text that will be in the alt attribute of the IMG tag. |
(string) The HTML for the IMG tag with appropriate information for displaying the icon.
protected function GetSettingsHTML( $id, $returnin, $params )
Retrieve the HTML for the settings page.
| $id | (numeric) The ID given to this module upon execution. |
| $returnid | (string) The ID of the page to return to when the required action is completed. An empty string means that it is just an internal page on the admin site whereas any numeric number is the ID of a frontend page. |
| $params | (array) An array containing various user inputs. |
(string) The HTML for the settings page.
protected function GetStoredTemplates( $id, $returnid, $params, $type )
Retrieve HTML for the listing of the templates.
| $id | (numeric) The ID given to this module upon execution. |
| $returnid | (string) The ID of the page to return to when the required action is completed. An empty string means that it is just an internal page on the admin site whereas any numeric number is the ID of a frontend page. |
| $params | (array) An array containing various user inputs. |
| $type | (string) The type of template to get the listing for. |
(string) The HTML for the listing of the templates.
protected function ShowFilterArea( $id, $returnid, $params, $type )
Retrieve the HTML for the filter area on the backend.
| $id | (numeric) The ID given to this module upon execution. |
| $returnid | (string) The ID of the page to return to when the required action is completed. An empty string means that it is just an internal page on the admin site whereas any numeric number is the ID of a frontend page. |
| $params | (array) An array containing various user inputs. |
| $type | (string) The type of template to get the listing for. |
(string) The HTML for the filter area.
protected function ShowFrontendCSS( $css = NULL )
Retrieve the HTML for the frontend CSS inclusion.
| $id | (numeric) The ID given to this module upon execution. |
| $returnid | (string) The ID of the page to return to when the required action is completed. An empty string means that it is just an internal page on the admin site whereas any numeric number is the ID of a frontend page. |
| $params | (array) An array containing various user inputs. |
| $css | (string) Optional and defaults to NULL. The CSS template to retrieve. |
(string) The HTML for the frontend CSS.
protected function ShowListingArea( $id, $returnid, $params, $type )
Retrieve the HTML for the listing area on the backend.
| $id | (numeric) The ID given to this module upon execution. |
| $returnid | (string) The ID of the page to return to when the required action is completed. An empty string means that it is just an internal page on the admin site whereas any numeric number is the ID of a frontend page. |
| $params | (array) An array containing various user inputs. |
| $type | (string) The type of template to get the listing for. |
(string) The HTML for the listing area.
protected function ShowSettingsArea( $id, $returnid, $params )
Retrieve the HTML for the settings area on the backend.
| $id | (numeric) The ID given to this module upon execution. |
| $returnid | (string) The ID of the page to return to when the required action is completed. An empty string means that it is just an internal page on the admin site whereas any numeric number is the ID of a frontend page. |
| $params | (array) An array containing various user inputs. |
(string) The HTML for the settings area.
protected function ShowSubmissionForm( $id, $returnid, $params, $group, $template = NULL )
Retrieve the HTML for the submission form on the frontend.
| $id | (numeric) The ID given to this module upon execution. |
| $returnid | (string) The ID of the page to return to when the required action is completed. An empty string means that it is just an internal page on the admin site whereas any numeric number is the ID of a frontend page. |
| $params | (array) An array containing various user inputs. |
| $group | (string) The name of the comment group to submit the comment. |
| $template | (string) Optional and defaults to NULL. If it is NULL, then the default template will be used. |
(string) The HTML for the submission form.
protected function ShowTemplateArea( $id, $returnid, $params, $type )
Retrieve the HTML for the template area.
| $id | (numeric) The ID given to this module upon execution. |
| $returnid | (string) The ID of the page to return to when the required action is completed. An empty string means that it is just an internal page on the admin site whereas any numeric number is the ID of a frontend page. |
| $params | (array) An array containing various user inputs. |
| $type | (string) The type of template to get the listing for. |
(string) The HTML for the template area.
protected function ShowUserComments( $group, $template = NULL )
Retrieve the HTML for the user comments.
| $group | (string) The name of the comment group to submit the comment. |
| $template | (string) Optional and defaults to NULL. If it is NULL, then the default template will be used. |
(string) The HTML for the user comments.
A boolean specifiying whether or not we should connect to the database to retrieve the current list of comment groups or use what is in the cache.
protected $get_groups
Create a new instance of DLComments.
public function __construct()
Retrieve all the comment groups currently in the database.
protected function GetCommentsGroups( $htmlentities = FALSE )
Retrieve various information regarding the listing of the comments.
protected function GetCommentsListing( $id, $returnid, $params )
A wrapper function for calling “DLSupport::GetIcon” since the majority of the icon retrieval will be on the same size.
protected function GetIcon( $icon, $alt = '', $size = 32 )
Retrieve the icon for the frontend.
protected function GetIconFrontend( $icon, $alt )
Retrieve the HTML for the settings page.
protected function GetSettingsHTML( $id, $returnin, $params )
Retrieve HTML for the listing of the templates.
protected function GetStoredTemplates( $id, $returnid, $params, $type )
Retrieve the HTML for including required JavaScript and CSS on an admin page.
protected function IncludeAdmin()
Retrieve the HTML for including required JavaScript and CSS on a regular page.
protected function IncludeFrontend()
Retrieve the HTML for the filter area on the backend.
protected function ShowFilterArea( $id, $returnid, $params, $type )
Retrieve the HTML for the frontend CSS inclusion.
protected function ShowFrontendCSS( $css = NULL )
Retrieve the HTML for the listing area on the backend.
protected function ShowListingArea( $id, $returnid, $params, $type )
Retrieve the HTML for the settings area on the backend.
protected function ShowSettingsArea( $id, $returnid, $params )
Retrieve the HTML for the submission form on the frontend.
protected function ShowSubmissionForm( $id, $returnid, $params, $group, $template = NULL )
Retrieve the HTML for the template area.
protected function ShowTemplateArea( $id, $returnid, $params, $type )
Retrieve the HTML for the user comments.
protected function ShowUserComments( $group, $template = NULL )
Undo any upgrades that has been made.
protected function Degrade( $start, $counter )