本文整理汇总了PHP中ModUtil::getIdFromName方法的典型用法代码示例。如果您正苦于以下问题:PHP ModUtil::getIdFromName方法的具体用法?PHP ModUtil::getIdFromName怎么用?PHP ModUtil::getIdFromName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModUtil
的用法示例。
在下文中一共展示了ModUtil::getIdFromName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Header
function Header()
{
$modid = ModUtil::getIdFromName('IWmain');
$modinfo = ModUtil::getInfo($modid);
// Si variable 'encap' no té contingut o el mòdul IWmain no està actiu no apareixerà encapçalament
if(($modinfo['state'] != 3) ||(!is_null(ModUtil::getVar('IWbooks', 'encap')))){
$imatge = ModUtil::getVar('IWmain', 'documentRoot').'/'.ModUtil::getVar('IWbooks', 'encap');
if (file_exists($imatge) && (ModUtil::getVar('IWbooks', 'encap') != '')){
$this->Image($imatge,8,6,180);
}
}
//$this->Image(ModUtil::getVar('IWbooks', 'encap'),8,6,180);
//$dir = ModUtil::getVar('IWmain', 'documentRoot')."/public/encap.jpg";
//$dir = ModUtil::getVar('IWmain', 'documentRoot').$imatge;
//Arial bold 15
$this->SetFont('Arial','B',15);
//Ens movem a la dreta
$this->Cell(80);
//Títol
//Salt de línia
$this->Ln(30);
if (ModUtil::getVar('IWbooks', 'marca_aigua') == 1)
{
// Fer marca d'aigua
$this->SetFont('Arial','B',50);
$this->SetTextColor(140,140,140);
$this->RotatedText(50,190,'P r o v i s i o n a l',45);
}
}
示例2: Install
public function Install() {
// Checks if module IWmain is installed. If not returns error
$modid = ModUtil::getIdFromName('IWmain');
$modinfo = ModUtil::getInfo($modid);
if ($modinfo['state'] != 3) {
return LogUtil::registerError($this->$this->__('Module IWmain is needed. You have to install the IWmain module before installing it.'));
}
// Check if the version needed is correct
$versionNeeded = '3.0.0';
if (!ModUtil::func('IWmain', 'admin', 'checkVersion', array('version' => $versionNeeded))) {
return false;
}
// Create module table
if (!DBUtil::createTable('IWusers'))
return false;
if (!DBUtil::createTable('IWusers_friends'))
return false;
// Create the index
if (!DBUtil::createIndex('iw_uid', 'IWusers', 'uid'))
return false;
if (!DBUtil::createIndex('iw_uid', 'IWusers_friends', 'uid'))
return false;
if (!DBUtil::createIndex('iw_fid', 'IWusers_friends', 'fid'))
return false;
//Create module vars
$this->setVar('friendsSystemAvailable', 1)
->setVar('invisibleGroupsInList', '$')
->setVar('usersCanManageName', 0)
->setVar('allowUserChangeAvatar', '1')
->setVar('allowUserSetTheirSex', '0')
->setVar('allowUserDescribeTheirSelves', '1')
->setVar('avatarChangeValidationNeeded', '1')
->setVar('usersPictureFolder', 'photos');
return true;
}
示例3: Install
public function Install() {
// Checks if module IWmain is installed. If not returns error
$modid = ModUtil::getIdFromName('IWmain');
$modinfo = ModUtil::getInfo($modid);
if ($modinfo['state'] != 3) {
return LogUtil::registerError($this->__('Module IWmain is needed. You have to install the IWmain module before installing it.'));
}
// Check if the version needed is correct
$versionNeeded = '2.0';
if (!ModUtil::func('IWmain', 'admin', 'checkVersion', array('version' => $versionNeeded))) {
return false;
}
// create module tables
$tables = array('IWstats', 'IWstats_summary');
foreach ($tables as $table) {
if (!DBUtil::createTable($table)) {
return false;
}
}
// create several indexes for IWstats table
$table = DBUtil::getTables();
$c = $table['IWstats_column'];
if (!DBUtil::createIndex($c['moduleid'], 'IWstats', 'moduleid')) {
return false;
}
if (!DBUtil::createIndex($c['uid'], 'IWstats', 'uid')) {
return false;
}
if (!DBUtil::createIndex($c['ip'], 'IWstats', 'ip')) {
return false;
}
if (!DBUtil::createIndex($c['ipForward'], 'IWstats', 'ipForward')) {
return false;
}
if (!DBUtil::createIndex($c['ipClient'], 'IWstats', 'ipClient')) {
return false;
}
if (!DBUtil::createIndex($c['userAgent'], 'IWstats', 'userAgent')) {
return false;
}
if (!DBUtil::createIndex($c['isadmin'], 'IWstats', 'isadmin')) {
return false;
}
// Set up config variables
$this->setVar('skippedIps', '')
->setVar('modulesSkipped', '')
->setVar('deleteFromDays', 90)
->setVar('keepDays', 90);
// create the system init hook
EventUtil::registerPersistentModuleHandler('IWstats', 'core.postinit', array('IWstats_Listeners', 'coreinit'));
// Initialisation successful
return true;
}
示例4: main
public function main() {
// Security check
if (!SecurityUtil::checkPermission('IWvhmenu::', '::', ACCESS_ADMIN)) {
return LogUtil::registerPermissionError();
}
// Checks if module IWmain is installed. If not returns error
$modid = ModUtil::getIdFromName('IWmain');
$modinfo = ModUtil::getInfo($modid);
if ($modinfo['state'] != 3) {
return LogUtil::registerError($this->__('Module IWmain is needed. You have to install the IWmain module previously to install it.'));
}
// Check if the version needed is correct. If not return error
$versionNeeded = '2.0';
if (!ModUtil::func('IWmain', 'admin', 'checkVersion', array('version' => $versionNeeded))) {
return false;
}
// Gets the groups information
$sv = ModUtil::func('IWmain', 'user', 'genSecurityValue');
$grupsInfo = ModUtil::func('IWmain', 'user', 'getAllGroupsInfo', array('sv' => $sv));
// Get the menu
$menu = ModUtil::func('IWvhmenu', 'admin', 'getsubmenu', array('id_parent' => 0,
'grups_info' => $grupsInfo,
'level' => 0));
// Pass the data to the template
return $this->view->assign('menuarray', $menu)
->assign('image_folder', ModUtil::getVar('IWvhmenu', 'imagedir'))
->fetch('IWvhmenu_admin_main.htm');
}
示例5: profile
public function profile() {
// Security check
if (!SecurityUtil::checkPermission('IWusers::', "::", ACCESS_READ) || !UserUtil::isLoggedIn()) {
throw new Zikula_Exception_Forbidden();
}
$uid = UserUtil::getVar('uid');
$sv = ModUtil::func('IWmain', 'user', 'genSecurityValue');
$photo = ModUtil::func('IWmain', 'user', 'getUserPicture', array('uname' => UserUtil::getVar('uname'),
'sv' => $sv));
$sv = ModUtil::func('IWmain', 'user', 'genSecurityValue');
$photo_s = ModUtil::func('IWmain', 'user', 'getUserPicture', array('uname' => '_' . UserUtil::getVar('uname'),
'sv' => $sv));
//Check if gd library is available
if (extension_loaded('gd') && ModUtil::getVar('IWusers', 'allowUserChangeAvatar') == 1)
$canChangeAvatar = true;
//Check if the users picture folder exists
if (!file_exists(ModUtil::getVar('IWmain', 'documentRoot') . '/' . ModUtil::getVar('IWusers', 'usersPictureFolder')) || ModUtil::getVar('IWusers', 'usersPictureFolder') == '') {
$canChangeAvatar = false;
} else {
if (!is_writeable(ModUtil::getVar('IWmain', 'documentRoot') . '/' . ModUtil::getVar('IWusers', 'usersPictureFolder')))
$canChangeAvatar = false;
}
// checks if user can change their real names
$modid = ModUtil::getIdFromName('IWusers');
$modinfo = ModUtil::getInfo($modid);
$usersCanManageName = (ModUtil::getVar('IWusers', 'usersCanManageName') == 1) ? true : false;
$allowUserSetTheirSex = (ModUtil::getVar('IWusers', 'allowUserSetTheirSex') == 1) ? true : false;
$allowUserDescribeTheirSelves = (ModUtil::getVar('IWusers', 'allowUserDescribeTheirSelves') == 1) ? true : false;
$userSurname1 = '';
$userSurname2 = '';
if ($modinfo['state'] == 3) {
$sv = ModUtil::func('IWmain', 'user', 'genSecurityValue');
$userInfo = ModUtil::func('IWmain', 'user', 'getUserInfo', array('uid' => UserUtil::getVar('uid'),
'info' => array('n', 'c1', 'c2', 'd', 's'),
'sv' => $sv));
$userName = $userInfo['n'];
$userSurname1 = $userInfo['c1'];
$userSurname2 = $userInfo['c2'];
$description = $userInfo['d'];
$sex = $userInfo['s'];
}
return $this->view->assign('avatarChangeValidationNeeded', ModUtil::getVar('IWusers', 'avatarChangeValidationNeeded'))
->assign('photo', $photo)
->assign('photo_s', $photo_s)
->assign('canChangeAvatar', $canChangeAvatar)
->assign('usersCanManageName', $usersCanManageName)
->assign('allowUserSetTheirSex', $allowUserSetTheirSex)
->assign('allowUserDescribeTheirSelves', $allowUserDescribeTheirSelves)
->assign('userName', $userName)
->assign('userSurname1', $userSurname1)
->assign('userSurname2', $userSurname2)
->assign('description', $description)
->assign('sex', $sex)
->fetch('IWusers_user_profile.htm');
}
示例6: upgrade
public function upgrade()
{
$filemodules = \ModUtil::apiFunc('ZikulaExtensionsModule', 'admin', 'getfilemodules');
\ModUtil::apiFunc('ZikulaExtensionsModule', 'admin', 'regenerate', ['filemodules' => $filemodules]);
$worked = \ModUtil::apiFunc('ZikulaExtensionsModule', 'admin', 'upgrade', ['id' => \ModUtil::getIdFromName('CmfcmfMediaModule')]);
if ($worked == true) {
return $worked;
}
return $this->translator->trans('Something went wrong with the upgrade code. This should not have happened!', [], $this->domain);
}
示例7: install
/**
* Initialise the IWmyrole module creating module vars
* @author Albert Pérez Monfort (aperezm@xtec.cat)
* @author Josep Ferràndiz Farré (jferran6@xtec.cat)
* @return bool true if successful, false otherwise
*/
public function install() {
// Checks if module IWmain is installed. If not returns error
$modid = ModUtil::getIdFromName('IWmain');
$modinfo = ModUtil::getInfo($modid);
if ($modinfo['state'] != 3) {
return LogUtil::registerError($this->__('Module IWmain is required. You have to install the IWmain module previously to install it.'));
}
// Check if the version needed is correct
$versionNeeded = '3.0.0';
if (!ModUtil::func('IWmain', 'admin', 'checkVersion', array('version' => $versionNeeded))) {
return false;
}
// Name of the initial group
$name = "changingRole";
// The API function is called.
$check = ModUtil::apiFunc('Groups', 'admin', 'getgidbyname', array('name' => $name));
if ($check != false) {
// Group already exists
// LogUtil::registerError (_GROUPS_ALREADYEXISTS);
$gid = $check;
} else {
// Falta mirar si existeix
$gid = ModUtil::apiFunc('Groups', 'admin', 'create', array('name' => $name,
'gtype' => 0,
'state' => 0,
'nbumax' => 0,
'description' => $this->__('Initial group of users that can change the role')));
// Success
}
// The return value of the function is checked here
if ($gid != false) {
$this->setVar('rolegroup', $gid);
// Gets the first sequence number of permissions list
$pos = DBUtil::selectFieldMax('group_perms', 'sequence', 'MIN');
// SET MODULE AND BLOCK PERMISSIONS
// insert permission myrole:: :: administration in second place
ModUtil::apiFunc('permissions', 'admin', 'create', array('realm' => 0,
'id' => $gid,
'component' => 'IWmyrole::',
'instance' => '::',
'level' => '800',
'insseq' => $pos + 1));
}
$this->setVar('groupsNotChangeable', '');
//Initialation successfull
return true;
}
示例8: Install
/**
* Initialise the IWmenu module creating module tables and module vars
* @author Albert Perez Monfort (aperezm@xtec.cat)
* @return bool true if successful, false otherwise
*/
public function Install() {
// Checks if module IWmain is installed. If not returns error
$modid = ModUtil::getIdFromName('IWmain');
$modinfo = ModUtil::getInfo($modid);
if ($modinfo['state'] != 3) {
return LogUtil::registerError($this->__('Module IWmain is needed. You have to install the IWmain module previously to install it.'));
}
// Check if the version needed is correct
$versionNeeded = '3.0.0';
if (!ModUtil::func('IWmain', 'admin', 'checkVersion', array('version' => $versionNeeded))) {
return false;
}
// Create module table
if (!DBUtil::createTable('IWmenu'))
return false;
//Create indexes
$pntable = DBUtil::getTables();
$c = $pntable['IWmenu_column'];
if (!DBUtil::createIndex($c['id_parent'], 'IWmenu', 'id_parent'))
return false;
//Create module vars
ModUtil::setVar('IWmenu', 'height', 26); // Default height
ModUtil::setVar('IWmenu', 'width', 200); // Default width
ModUtil::setVar('IWmenu', 'imagedir', "menu"); // Default directori of menu images
// checks if module vhmenu exists. If it exists import module vhmenu tables
$modid = ModUtil::getIdFromName('IWmenu');
$modinfo = ModUtil::getInfo($modid);
if ($modinfo['state'] == 3) {
// get the objects from the db
ModUtil::load('IWvhmenu', 'user');
$items = DBUtil::selectObjectArray('IWvhmenu');
if ($items) {
foreach ($items as $item) {
$groups = str_replace('|0', '', $item['groups']);
$groups = substr($groups, 1, strlen($groups));
$itemArray = array('text' => $item['text'],
'url' => $item['url'],
'icon' => '',
'id_parent' => $item['id_parent'],
'groups' => $groups,
'active' => $item['active'],
'target' => $item['target'],
'descriu' => $item['descriu']);
DBUtil::insertObject($itemArray, 'IWmenu', 'mid');
}
}
}
return true;
}
示例9: Install
/**
* Initialise the IWnoteboard module creating module tables and module vars
* @author Albert Pérez Monfort (aperezm@xtec.cat)
* @return bool true if successful, false otherwise
*/
public function Install() {
// Checks if module IWmain is installed. If not returns error
$modid = ModUtil::getIdFromName('IWmain');
$modinfo = ModUtil::getInfo($modid);
if ($modinfo['state'] != 3) {
return LogUtil::registerError($this->__('Module IWmain is required. You have to install the IWmain module previously to install it.'));
}
// Check if the version needed is correct
$versionNeeded = '3.0.0';
if (!ModUtil::func('IWmain', 'admin', 'checkVersion', array('version' => $versionNeeded))) {
return false;
}
// Create module tables
if (!DBUtil::createTable('IWnoteboard'))
return false;
if (!DBUtil::createTable('IWnoteboard_topics'))
return false;
//Create module vars
$this->setVar('grups', '')
->setVar('permisos', '')
->setVar('marcat', '')
->setVar('verifica', '')
->setVar('caducitat', '30')
->setVar('repperdefecte', '1')
->setVar('colorrow1', '#FFFFFF')
->setVar('colorrow2', '#FFFFCC')
->setVar('colornewrow1', '#FFCC99')
->setVar('colornewrow2', '#99FFFF')
->setVar('attached', 'noteboard')
->setVar('notRegisteredSeeRedactors', '1')
->setVar('multiLanguage', '0')
->setVar('topicsSystem', '0')
->setVar('shipHeadersLines', '0')
->setVar('notifyNewEntriesByMail', '0')
->setVar('editPrintAfter', '-1')
->setVar('notifyNewCommentsByMail', '1')
->setVar('commentCheckedByDefault', '1')
->setVar('smallAvatar', '0');
HookUtil::registerSubscriberBundles($this->version->getHookSubscriberBundles());
//Initialation successfull
return true;
}
示例10: Install
/**
* Initialise the IWforums module creating module tables and module vars
* @author Albert Pérez Monfort (aperezm@xtec.cat)
* @return bool true if successful, false otherwise
*/
public function Install() {
// Checks if module IWmain is installed. If not returns error
$modid = ModUtil::getIdFromName('IWmain');
$modinfo = ModUtil::getInfo($modid);
if ($modinfo['state'] != 3) {
return LogUtil::registerError($this->__('Module IWmain is required. You have to install the IWmain module previously to install it.'));
}
// Check if the version needed is correct
$versionNeeded = '3.0.2';
if (!ModUtil::func('IWmain', 'admin', 'checkVersion', array('version' => $versionNeeded))) {
return false;
}
// Create module tables
if (!DBUtil::createTable('IWforums_definition'))
return false;
if (!DBUtil::createTable('IWforums_temes'))
return false;
if (!DBUtil::createTable('IWforums_msg'))
return false;
//Create indexes
$tables = DBUtil::getTables();
$c = $tables['IWforums_msg_column'];
if (!DBUtil::createIndex($c['idparent'], 'IWforums_msg', 'idparent'))
return false;
if (!DBUtil::createIndex($c['ftid'], 'IWforums_msg', 'ftid'))
return false;
if (!DBUtil::createIndex($c['fid'], 'IWforums_msg', 'fid'))
return false;
$c = $tables['IWforums_temes_column'];
if (!DBUtil::createIndex($c['fid'], 'IWforums_temes', 'fid'))
return false;
//Create module vars
$this->setVar('urladjunts', 'forums')
->setVar('avatarsVisible', '1')
->setVar('restyledTheme', '1')
->setVar('smiliesActive', '1');
HookUtil::registerSubscriberBundles($this->version->getHookSubscriberBundles());
//Initialation successfull
return true;
}
示例11: install
public function install(){
if (!SecurityUtil::checkPermission('Cataleg::', '::', ACCESS_ADMIN)) {
return LogUtil::registerPermissionError();
}
// Verificar si el mòdul IWusers està instal·lat. Si no ho està, retorna error
$modid = ModUtil::getIdFromName('IWusers');
$modinfo = ModUtil::getInfo($modid);
if ($modinfo['state'] != 3) {
return LogUtil::registerError($this->__('El mòdul IWusers és imprescindible. Cal tenir-lo instal·lat abans d\'instal·lar el mòdul del catàleg.'));
}
// Verificar versió del mòdul IWusers
$versionNeeded = '3.1.0';
if ($modinfo['version'] < $versionNeeded) {
throw new Zikula_Exception_Forbidden($this->__('Versió del mòdul IWusers incorrecta. Versió mínima 3.1.0'));
}
// Crear les taules del mòdul
if (!DBUtil::createTable('cataleg')||
!DBUtil::createTable('cataleg_eixos')||
!DBUtil::createTable('cataleg_prioritats')||
!DBUtil::createTable('cataleg_unitatsImplicades')||
!DBUtil::createTable('cataleg_subprioritats')||
!DBUtil::createTable('cataleg_activitats')||
!DBUtil::createTable('cataleg_activitatsZona')||
!DBUtil::createTable('cataleg_unitats')||
!DBUtil::createTable('cataleg_responsables')||
!DBUtil::createTable('cataleg_contactes')||
!DBUtil::createTable('cataleg_auxiliar')||
!DBUtil::createTable('cataleg_centresActivitat')||
!DBUtil::createTable('cataleg_centres')||
!DBUtil::createTable('cataleg_gestioActivitatDefaults')||
!DBUtil::createTable('cataleg_importTaules')||
!DBUtil::createTable('cataleg_importAssign') ||
!DBUtil::createTable('cataleg_gtafEntities') ||
!DBUtil::createTable('cataleg_gtafGroups')
)
return false;
ModUtil::setVar($this->name, 'novetats', array('dataPublicacio'=>'','diesNovetats'=> 15, 'showNew' => true, 'showMod' => true));
HookUtil::registerSubscriberBundles($this->version->getHookSubscriberBundles());
//Successfull
return true;
}
示例12: display
/**
* display block
*/
public function display($blockinfo)
{
// Security check
if (!SecurityUtil::checkPermission('Admin:adminnavblock', "{$blockinfo['title']}::{$blockinfo['bid']}", ACCESS_ADMIN)) {
return;
}
// Get variables from content block
$vars = BlockUtil::varsFromContent($blockinfo['content']);
// Call the modules API to get the items
if (!ModUtil::available('Admin')) {
return;
}
$items = ModUtil::apiFunc('Admin', 'admin', 'getall');
// Check for no items returned
if (empty($items)) {
return;
}
// get admin capable modules
$adminmodules = ModUtil::getAdminMods();
$adminmodulescount = count($adminmodules);
// Display each item, permissions permitting
$admincategories = array();
foreach ($items as $item) {
if (SecurityUtil::checkPermission('Admin::', "{$item['catname']}::{$item['cid']}", ACCESS_READ)) {
$adminlinks = array();
foreach ($adminmodules as $adminmodule) {
// Get all modules in the category
$catid = ModUtil::apiFunc('Admin', 'admin', 'getmodcategory', array('mid' => ModUtil::getIdFromName($adminmodule['name'])));
if ($catid == $item['cid'] || $catid == false && $item['cid'] == $this->getVar('defaultcategory')) {
$modinfo = ModUtil::getInfoFromName($adminmodule['name']);
$menutexturl = ModUtil::url($modinfo['name'], 'admin');
$menutexttitle = $modinfo['displayname'];
$adminlinks[] = array('menutexturl' => $menutexturl, 'menutexttitle' => $menutexttitle);
}
}
$admincategories[] = array('url' => ModUtil::url('Admin', 'admin', 'adminpanel', array('cid' => $item['cid'])), 'title' => DataUtil::formatForDisplay($item['catname']), 'modules' => $adminlinks);
}
}
$this->view->assign('admincategories', $admincategories);
// Populate block info and pass to theme
$blockinfo['content'] = $this->view->fetch('admin_block_adminnav.tpl');
return BlockUtil::themeBlock($blockinfo);
}
示例13: uninstall
/**
* Delete the IWTimeFrames module & update existing bookings references
* @author Albert Pérez Monfort (aperezm@xtec.cat)
* @author Josep Ferràndiz Farré (jferran6@xtec.cat)
* @return bool true if successful, false otherwise
*/
public function uninstall() {
// Delete module table
DBUtil::dropTable('IWtimeframes');
DBUtil::dropTable('IWtimeframes_definition');
// Totes les referències als marcs s'han d'esborrar a IWbookings_spaces
// 1r. mirar si existeix el mòdul i després actualitzar els registres
$modid = ModUtil::getIdFromName('IWbookings');
$modinfo = ModUtil::getInfo($modid);
if ($modinfo['state'] > 1) {
$obj = array('mdid' => 0);
DBUtil::updateObject($obj, 'IWbookings_spaces', 'mdid != 0');
}
//Delete module vars
$this->delVar('frames');
//Deletion successfull
return true;
}
示例14: Install
/**
* Initialise the IWbookings module creating module tables and module vars
* @author Albert Pérez Monfort (aperezm@xtec.cat)
* @author Josep Ferràndiz Farré (jferran6@xtec.cat)
* @return bool true if successful, false otherwise
*/
public function Install() {
// Checks if module IWmain is installed. If not returns error
$modid = ModUtil::getIdFromName('IWmain');
$modinfo = ModUtil::getInfo($modid);
if ($modinfo['state'] != 3) {
return LogUtil::registerError($this->__('Module IWmain is required. You have to install the IWmain module previously to install it.'));
}
// Check if the version needed is correct
$versionNeeded = '3.0.0';
if (!ModUtil::func('IWmain', 'admin', 'checkVersion', array('version' => $versionNeeded))) {
return false;
}
// Create module tables
if (!DBUtil::createTable('IWbookings'))
return false;
if (!DBUtil::createTable('IWbookings_spaces'))
return false;
//Create indexes
$pntable = DBUtil::getTables();
$c = $pntable['IWbookings_column'];
if (!DBUtil::createIndex($c['sid'], 'IWbookings', 'sid'))
return false;
if (!DBUtil::createIndex($c['start'], 'IWbookings', 'start'))
return false;
//Create module vars
ModUtil::setVar('IWbookings', 'group', ''); //grup
ModUtil::setVar('IWbookings', 'weeks', '1'); // setmanes
ModUtil::setVar('IWbookings', 'month_panel', '0'); // taula_mes
ModUtil::setVar('IWbookings', 'weekends', '0'); // capssetmana
ModUtil::setVar('IWbookings', 'eraseold', '1'); // delantigues
ModUtil::setVar('IWbookings', 'showcolors', '0'); // mostracolors
ModUtil::setVar('IWbookings', 'NTPtime', '0');
//Initialation successfull
return true;
}
示例15: Install
public function Install() {
// Checks if module IWmain is installed. If not returns error
$modid = ModUtil::getIdFromName('IWmain');
$modinfo = ModUtil::getInfo($modid);
if ($modinfo['state'] != 3) {
return LogUtil::registerError($this->__('Module IWmain is needed. You have to install the IWmain module before installing it.'));
}
// Check if the version needed is correct
$versionNeeded = '3.0.0';
if (!ModUtil::func('IWmain', 'admin', 'checkVersion', array('version' => $versionNeeded))) {
return false;
}
// Create module tables
if (!DBUtil::createTable('IWmessages'))
return false;
//Create indexes
$pntable = DBUtil::getTables();
$c = $pntable['IWmessages_column'];
if (!DBUtil::createIndex($c['from_userid'], 'IWmessages', 'from_userid'))
return false;
if (!DBUtil::createIndex($c['to_userid'], 'IWmessages', 'to_userid'))
return false;
//Set module vars
$this->setVar('groupsCanUpdate', '$')
->setVar('uploadFolder', 'messages')
->setVar('multiMail', '$')
->setVar('limitInBox', '50')
->setVar('limitOutBox', '50')
->setVar('dissableSuggest', '0')
->setVar('smiliesActive', '1');
HookUtil::registerSubscriberBundles($this->version->getHookSubscriberBundles());
return true;
}