Commit f689bc33 authored by Leif Andersson's avatar Leif Andersson
Browse files

Initial commit

parents
<?php
#-------------------------------------------------------------------------
# Module: ReglerAddress - Module for manaiging the control.lth.se
# address database
#
#-------------------------------------------------------------------------
/**
* Your initial Class declaration. This file's name must
* be "[class's name].module.php", or, in this case,
* ReglerAddress.module.php
*/
/**
* ReglerAddress class
*
* @author Leif Andersson
* @since 1.0
* @version 2015-09-02
* @modifiedby $LastChangedBy: LA $
* @lastmodified $Date: 2015-09-02$
* @license GPL
**/
class ReglerAddress extends CMSModule
{
/**
* GetName()
* return get_class($this);
* @return string class name
*/
function GetName() { return get_class($this); }
/**
* GetFriendlyName()
* @return string Friendly name for the module
*/
function GetFriendlyName() { return 'ReglerAddress'; }
/**
* GetVersion()
* @return string version number (can be something like 1.4rc1)
*/
function GetVersion() { return '2015-09-02'; }
/**
* GetHelp()
* @return string Help for this module
*/
function GetHelp() { return 'help'; }
/**
* GetAuthor()
* @return string Author name
*/
function GetAuthor() { return 'Leif Andersson'; }
/**
* GetAuthorEmail()
* @return string Authors email
*/
function GetAuthorEmail() {return 'leif.andersson@control.lth.se'; }
/**
* GetChangeLog()
* @return string ChangeLog for this module
*/
function GetChangeLog() { return $this->Lang('changelog'); }
/**
* IsPluginModule()
* @return bool True if this module can be included in page and or template
*/
function IsPluginModule() { return true; }
/**
* HasAdmin()
* @return bool True if this module has admin area
*/
function HasAdmin()
{
return True; }
/**
* GetAdminSection()
* If your module has an Admin Panel, you can specify
* which Admin Section (or top-level Admin Menu) it shows
* up in. This method returns a string to specify that
* section. Valid return values are:
*
* main - the Main menu tab.
* content - the Content menu
* layout - the Layout menu
* usersgroups - the Users and Groups menu
* extensions - the Extensions menu (this is the default)
* siteadmin - the Site Admin menu
* viewsite - the View Site menu tab
* logout - the Logout menu tab
*
* Note that if you place your module in the main,
* viewsite, or logout sections, it will show up in the
* menus, but will not be visible in any top-level
* section pages.
* @return string Which admin section this module belongs to
*/
function GetAdminSection() { return 'content'; }
/**
* GetAdminDescription()
* @return string Module description
*/
function GetAdminDescription() { return 'ReglerAddress admin'; }
/**
* VisibleToAdminUser()
* @return bool True if this module is shown to current user
*/
function VisibleToAdminUser() {
return $this->CheckPermission('Use ReglerAddress');
}
/**
* GetDependencies()
* @return hash Hash of other modules this module depends on
*/
function GetDependencies() { return array(); }
/**
* @return string Minimum cms version this module should work on
*/
function MinimumCMSVersion() { return "1.0"; }
/**
* MaximumCMSVersion()
* It can also be a major pain if you don't have time to
* update your modules every time a new release of CMSMS comes
* out, hence this is commented out here.
*/
/*
function MaximumCMSVersion()
{
return "1.5";
}
*/
/**
* SetParameters()
* This function enables you to
* 1) create mappings for your module when using "Pretty Urls".
* 2) impose security by controlling incoming parameters
*
* Pretty URLS:
* Typically, modules create internal links that have
* big ugly strings along the lines of:
* index.php?mact=ModName,cntnt01,actionName,0&cntnt01param1=1&cntnt01param2=2&cntnt01returnid=3
*
* You might prefer these to look like:
* /ModuleFunction/2/3
*
* To do this, you have to register routes and map
* your parameters in a way that the API will be able
* to understand.
*
* Also note that any calls to CreateLink will need to
* be updated to pass the pretty url parameter.
*
* Security:
* By using the RestrictUnknownParams function, your module will not
* receive any parameters other than the ones you declare here.
* Furthermore, the parameters your module does receive will be filtered
* according to the rules you set here.
*/
function SetParameters() {
$this->RegisterModulePlugin();
$this->RestrictUnknownParams();
$this->CreateParameter('title','','title');
$this->SetParameterType('title',CLEAN_STRING);
$this->CreateParameter('author','','author');
$this->SetParameterType('author',CLEAN_STRING);
$help = 'The first year in the desired range.';
$this->CreateParameter('yearFrom','',$help);
$this->SetParameterType('yearFrom',CLEAN_INT);
$help = 'The last year in the desired range. If this parameter is unset, '
. 'the last publication selected is of current year and month. '
. 'The special value "0" is equivalent to a year far in the future.';
$this->CreateParameter('yearTo','',$help);
$this->SetParameterType('yearTo',CLEAN_INT);
$help = 'The article type. Possible values are book, inbook, '
. 'art (journal article), inproc (conference contribution), '
. 'phd, lic, msc, techrep, popsci, man, proc (The entire proceedings, '
. 'not an individual contribution), misc, unpubl';
$this->CreateParameter('articleType','',$help);
$this->SetParameterType('articleType',CLEAN_STRING);
$this->CreateParameter('keywords','','keywords');
$this->SetParameterType('keywords',CLEAN_STRING);
$this->CreateParameter('abstract','','abstract');
$this->SetParameterType('abstract',CLEAN_STRING);
$this->CreateParameter('project','','project');
$this->SetParameterType('project',CLEAN_STRING);
$this->CreateParameter('search','','search');
$this->SetParameterType('search',CLEAN_STRING);
$this->CreateParameter('annual','','annual');
$this->SetParameterType('annual',CLEAN_STRING);
$help = 'If true, then present a search form on the page.';
$this->CreateParameter('searchForm','true',$help);
$this->SetParameterType('searchForm',CLEAN_STRING);
$help = 'The unique author key.';
$this->CreateParameter('authkey','',$help);
$this->SetParameterType('authkey',CLEAN_STRING);
$help = 'Presentation style. Possible values: table (default), '
. 'short, full.';
$this->CreateParameter('style','',$help);
$this->SetParameterType('style',CLEAN_STRING);
$help = 'Limit the number of items presented to this.';
$this->CreateParameter('limit','',$help);
$this->SetParameterType('limit',CLEAN_INT);
$this->CreateParameter('request','','request');
$this->SetParameterType('request',CLEAN_STRING);
$this->CreateParameter('mailAddress','','mailAddress');
$this->SetParameterType('mailAddress',CLEAN_STRING);
$help = 'The unique publication key.';
$this->CreateParameter('artkey','',$help);
$this->SetParameterType('artkey',CLEAN_STRING);
$this->CreateParameter('year','','year');
$this->SetParameterType('year',CLEAN_STRING);
$this->CreateParameter('origid','','origid');
$this->SetParameterType('origid',CLEAN_STRING);
$this->CreateParameter('showBibtex','','showBibtex');
$this->SetParameterType('showBibtex',CLEAN_STRING);
$help = 'Publication status to select which publications to show. '
. 'Possible values: submitted, accepted, publishedOnline, published. '
. 'The values are ordered, so a specific value means '
. '"show with this value or higher". Default: accepted.';
$this->CreateParameter('publicationStatus','',$help);
$this->SetParameterType('publicationStatus',CLEAN_STRING);
$this->RegisterRoute('#Publication/(?P<artkey>.+$)#',
array('action'=>'showpublication', 'returnid'=>'60'));
}
/**
* InstallPostMessage()
* @return string Message to be shown after installation
*/
function InstallPostMessage() {
return 'Module ReglerAddress successfully installed.';
}
/**
* UninstallPostMessage()
* @return string Message to be shown after uninstallation
*/
function UninstallPostMessage() {
return 'Module ReglerAddress sucessfully uninstalled.';
}
/**
* UninstallPreMessage()
* @return string Message to be shown before uninstallation
*/
function UninstallPreMessage() {
return 'Confirm uninstalling ReglerAddress.'; }
/**
* Your methods here
*
* This would be a good place to define some general methods for your module
*
* Its a good practice to have underscore in front of your own methods
*/
function _SetStatus($oid, $status) {
//...
}
} //end class
?>
<?php
#-------------------------------------------------------------------------
# Module: ReglerAddress
# Version: 2015-09-02
# Method: Install
if (!isset($gCms)) exit;
// put mention into the admin log
$this->Audit( 0, 'ReglerAddress', 'installed');
?>
<?php
#-------------------------------------------------------------------------
# Module: ReglerAddress
# Version: 2015-09-02
# Method: Uninstall
if (!isset($gCms)) exit;
// put mention into the admin log
$this->Audit( 0, 'ReglerAddress', 'uninstalled');
?>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment