Beispiel #1
0
 public function install()
 {
     if (!SecurityUtil::checkPermission('Files::', '::', ACCESS_ADMIN)) {
         return LogUtil::registerPermissionError();
     }
     // set content of the files .htaccess and .locked
     $htaccessContent = "# Avoid direct web access to folder files\r\nOrder deny,allow\r\nDeny from all\r\n";
     $lockedContent = "# Avoid direct web access with the file file.php\r\n";
     // Create module table
     if (!DBUtil::createTable('Files')) {
         return false;
     }
     //Create indexes
     $pntable = DBUtil::getTables();
     $c = $pntable['Files_column'];
     DBUtil::createIndex($c['userId'], 'Files', 'userId');
     // create security files
     FileUtil::writeFile(ModUtil::getVar('Files', 'folderPath') . '/.htaccess', $htaccessContent, true);
     FileUtil::writeFile(ModUtil::getVar('Files', 'folderPath') . '/.locked', $lockedContent, true);
     FileUtil::writeFile(ModUtil::getVar('Files', 'folderPath') . '/' . ModUtil::getVar('Files', 'usersFolder') . '/.htaccess', $htaccessContent, true);
     FileUtil::writeFile(ModUtil::getVar('Files', 'folderPath') . '/' . ModUtil::getVar('Files', 'usersFolder') . '/.locked', $lockedContent, true);
     //Create module vars
     ModUtil::setVar('Files', 'showHideFiles', '0');
     ModUtil::setVar('Files', 'allowedExtensions', 'gif,png,jpg,odt,doc,pdf,zip');
     ModUtil::setVar('Files', 'defaultQuota', 1);
     ModUtil::setVar('Files', 'groupsQuota', 's:0:"";');
     ModUtil::setVar('Files', 'filesMaxSize', '1000000');
     ModUtil::setVar('Files', 'maxWidth', '250');
     ModUtil::setVar('Files', 'maxHeight', '250');
     ModUtil::setVar('Files', 'editableExtensions', 'php,htm,html,htaccess,css,js,tpl');
     // Set up module hook
     ModUtil::registerHook('item', 'display', 'GUI', 'Files', 'user', 'Files');
     return true;
 }
Beispiel #2
0
    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;
    }
Beispiel #3
0
    public function install() {
        if (!SecurityUtil::checkPermission('IWdocmanager::', '::', ACCESS_ADMIN)) {
            return LogUtil::registerPermissionError();
        }
        // Checks if module IWmain is installed. If not returns error
        if (!ModUtil::available('IWmain')) {
            return LogUtil::registerError(__('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;
        }

        if (!DBUtil::createTable('IWdocmanager'))
            return false;
        if (!DBUtil::createTable('IWdocmanager_categories'))
            return false;

        //Create indexes
        $table = DBUtil::getTables();
        $c = $table['IWdocmanager_column'];
        DBUtil::createIndex($c['author'], 'IWdocmanager', 'author');
        DBUtil::createIndex($c['categoryId'], 'IWdocmanager', 'categoryId');

        //Create module vars
        $this->setVar('documentsFolder', 'documents')
                ->setVar('notifyMail', '')
                ->setVar('editTime', '45')
                ->setVar('deleteTime', '20');

        return true;
    }
Beispiel #4
0
 /**
  * initialize the module
  */
 public function install()
 {
     if (!DBUtil::createTable('pagelock')) {
         return false;
     }
     return true;
 }
Beispiel #5
0
    /**
     * initialise the Feeds module
     */
    public function install()
    {
        // create table
        if (!DBUtil::createTable('feeds')) {
            return false;
        }

        // create cache directory
        CacheUtil::createLocalDir('feeds');

        // set up config variables
        $modvars = array(
                'enablecategorization' => true,
                'bold' => false,
                'openinnewwindow' => false,
                'itemsperpage' => 10,
                'cachedirectory' => 'feeds',
                'cacheinterval' => 180,
                'multifeedlimit' => 0,
                'usingcronjob' => 0,
                'key' => md5(time())
        );

        // create our default category
        if (!$this->_feeds_createdefaultcategory()) {
            LogUtil::registerStatus(__('Warning! Could not create the default Feeds category tree. If you want to use categorisation with Feeds, register at least one property for the module in the Category Registry.'));
            $modvars['enablecategorization'] = false;
        }

        // set up module variables
        ModUtil::setVars('Feeds', $modvars);

        // initialisation successful
        return true;
    }
Beispiel #6
0
 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;
 }
Beispiel #7
0
    /**
     * initialise the groups module
     * This function is only ever called once during the lifetime of a particular
     * module instance
     * @return bool true if initialisation succesful, false otherwise
     */
    public function install()
    {
        // create the groups table
        if (!DBUtil::createTable('groups')) {
            return false;
        }

        // create the group membership table
        if (!DBUtil::createTable('group_membership')) {
            return false;
        }

        // create the groups applications table
        if (!DBUtil::createTable('group_applications')) {
            return false;
        }

        // set all our module vars
        $this->setVar('itemsperpage', 25);
        $this->setVar('defaultgroup', 1);
        $this->setVar('mailwarning', 0);
        $this->setVar('hideclosed', 0);
        // Set the primary admin group gid as a module var so it is accessible by other modules,
        // but it should not be editable at this time. For now it is read-only.
        $this->setVar('primaryadmingroup', 2);

        // create the default data for the modules module
        $this->defaultdata();

        // Initialisation successful
        return true;
    }
Beispiel #8
0
    /**
     * Install the Extensions module.
     *
     * @return boolean
     */
    public function install()
    {
        // modules
        if (!DBUtil::createTable('modules')) {
            return false;
        }

        // module_vars
        if (!DBUtil::createTable('module_vars')) {
            return false;
        }

        // hooks
        if (!DBUtil::createTable('hooks')) {
            return false;
        }

        // module_deps
        if (!DBUtil::createTable('module_deps')) {
            return false;
        }

        // create hook provider table.
        Doctrine_Core::createTablesFromArray(array('Zikula_Doctrine_Model_HookArea', 'Zikula_Doctrine_Model_HookProvider', 'Zikula_Doctrine_Model_HookSubscriber', 'Zikula_Doctrine_Model_HookBinding', 'Zikula_Doctrine_Model_HookRuntime'));
        EventUtil::registerPersistentModuleHandler('Extensions', 'controller.method_not_found', array('Extensions_HookUI', 'hooks'));
        EventUtil::registerPersistentModuleHandler('Extensions', 'controller.method_not_found', array('Extensions_HookUI', 'moduleservices'));

        // populate default data
        $this->defaultdata();
        $this->setVar('itemsperpage', 25);

        // Initialisation successful
        return true;
    }
Beispiel #9
0
function mediashareCreateInvitationTable()
{
    // Media DB creation
    if (!DBUtil::createTable('mediashare_invitation')) {
        return false;
    }
    return true;
}
Beispiel #10
0
 /**
  * initialise the permissions module
  *
  * This function is only ever called once during the lifetime of a particular
  * module instance.
  * This function MUST exist in the pninit file for a module
  *
  * @return       bool       true on success, false otherwise
  */
 public function install()
 {
     if (!DBUtil::createTable('group_perms')) {
         return false;
     }
     // Create any default for this module
     $this->defaultdata();
     // Initialisation successful
     return true;
 }
Beispiel #11
0
    /**
     * Initialise the IWTimeFrames 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() {
        // Create module tables
        if (!DBUtil::createTable('IWtimeframes')) return false;
        if (!DBUtil::createTable('IWtimeframes_definition')) return false;

        //Create module vars
        $this->setVar('frames', '10'); //franges horàries
        //Initialation successfull
        return true;
    }
Beispiel #12
0
    /**
     * 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;
    }
Beispiel #13
0
    /**
     * Initialise the IWwebbox module creating module tables and module vars
     * @author Albert Pérez Monfort (intraweb@xtec.cat)
     * @return bool true if successful, false otherwise
     */
    public function install() {
        // Create module table
        if (!DBUtil::createTable('IWwebbox'))
            return false;

        //Create module vars
        $this->setVar('url', 'http://phobos.xtec.cat/intraweb')
                ->setVar('width', '100')
                ->setVar('height', '600')
                ->setVar('scrolls', '1')
                ->setVar('widthunit', '%');
        return true;
    }
Beispiel #14
0
/**
 * initialise the Admin module
 * This function is only ever called once during the lifetime of a particular
 * module instance
 * @author Mark West
 * @return bool true if initialisation succcesful, false otherwise
 */
function Admin_Messages_init()
{
    if (!DBUtil::createTable('message')) {
        return false;
    }
    // Set a default value for a module variable
    ModUtil::setVar('Admin_Messages', 'itemsperpage', 25);
    ModUtil::setVar('Admin_Messages', 'allowsearchinactive', false);
    // create the default data for the modules module
    Admin_Messages_defaultdata();
    // Initialisation successful
    return true;
}
Beispiel #15
0
    /**
     * Initialise the dynamic user data  module.
     *
     * @return boolean True on success or false on failure.
     */
    public function install()
    {
        if (!DBUtil::createTable('user_property')) {
            return false;
        }

        $this->setVars($this->getDefaultModVars());

        // create the default data for the module
        $this->defaultdata();
        EventUtil::registerPersistentEventHandlerClass($this->name, 'Profile_Listener_UsersUiHandler');

        // Initialisation successful
        return true;
    }
Beispiel #16
0
    /**
     * 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;
    }
Beispiel #17
0
    /**
     * 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;
    }
Beispiel #18
0
 /**
  * initialise the EZComments module
  *
  * This function initializes the module to be used. it creates tables,
  * registers hooks,...
  *
  * @return boolean true on success, false otherwise.
  */
 public function install()
 {
     // create main table
     if (!DBUtil::createTable('EZComments')) {
         return false;
     }
     // register hooks
     HookUtil::registerSubscriberBundles($this->version->getHookSubscriberBundles());
     HookUtil::registerProviderBundles($this->version->getHookProviderBundles());
     // register the module delete hook
     EventUtil::registerPersistentModuleHandler('EZComments', 'installer.module.uninstalled', array('EZComments_EventHandlers', 'moduleDelete'));
     EventUtil::registerPersistentModuleHandler('EZComments', 'installer.subscriberarea.uninstalled', array('EZComments_EventHandlers', 'hookAreaDelete'));
     // Misc
     $this->setVar('template', 'Standard');
     $this->setVar('css', 'style.css');
     $this->setVar('anonusersinfo', false);
     $this->setVar('anonusersrequirename', false);
     $this->setVar('logip', false);
     $this->setVar('itemsperpage', 25);
     $this->setVar('enablepager', false);
     $this->setVar('commentsperpage', 25);
     $this->setVar('migrated', array('dummy' => true));
     $this->setVar('useaccountpage', '1');
     // Notification
     $this->setVar('MailToAdmin', false);
     $this->setVar('moderationmail', false);
     // Moderation
     $this->setVar('moderation', 0);
     $this->setVar('alwaysmoderate', false);
     $this->setVar('dontmoderateifcommented', false);
     $this->setVar('modlinkcount', 2);
     $this->setVar('modlist', '');
     // Blacklisting
     $this->setVar('blacklinkcount', 5);
     $this->setVar('blacklist', '');
     $this->setVar('proxyblacklist', false);
     $this->setVar('modifyowntime', 6);
     // Akismet
     $this->setVar('akismet', false);
     $this->setVar('akismetstatus', 1);
     // Feeds
     $this->setVar('feedtype', 'rss');
     $this->setVar('feedcount', 10);
     // Initialisation successful
     return true;
 }
Beispiel #19
0
    /**
     * initialise the llibres module
     * This function is only ever called once during the lifetime of a particular
     * module instance
     */
    public function install() {

        if (!DBUtil :: createTable('IWbooks')) {
            return false;
        }

        if (!DBUtil :: createTable('IWbooks_materies')) {
            return false;
        }

        ModUtil::setVar('IWbooks', 'itemsperpage', 10);
        ModUtil::setVar('IWbooks', 'fpdf', 'modules/IWbooks/fpdf153/');

        if (date('m') > '5') {
            $cursacademic = date('Y');
        } else {
            $cursacademic = date('Y') - 1;
        }
        ModUtil::setVar('IWbooks', 'any', $cursacademic);
        ModUtil::setVar('IWbooks', 'encap', '');
        ModUtil::setVar('IWbooks', 'plans', '
PRI#Educació Primària|
ESO#Educació Secundària Obligatòria|
BTE#Batxillerat Tecnològic|
BSO#Batxillerat Social|
BHU#Batxillerat Humanístic|
BCI#Batxillerat Científic|
BAR#Batxillerat Artístic');
        ModUtil::setVar('IWbooks', 'darrer_nivell', '4');
        ModUtil::setVar('IWbooks', 'nivells', '
1#1r|
2#2n|
3#3r|
4#4t|
5#5è|
6#6è|
A#P3|
B#P4|
C#P5');
        ModUtil::setVar('IWbooks', 'llistar_materials', '1');
        ModUtil::setVar('IWbooks', 'mida_font', '11');
        ModUtil::setVar('IWbooks', 'marca_aigua', '0');
        // Inicialitzat amb �xit
        return true;
    }
Beispiel #20
0
 /**
  * initialise the Search module
  * This function is only ever called once during the lifetime of a particular
  * module instance
  */
 public function install()
 {
     // Creating the table
     if (!DBUtil::createTable('search_stat')) {
         return false;
     }
     // Creating the table
     if (!DBUtil::createTable('search_result')) {
         return false;
     }
     // create module vars
     $this->setVar('itemsperpage', 10);
     $this->setVar('limitsummary', 255);
     // register event handler to activate new modules in the search block
     EventUtil::registerPersistentModuleHandler('Search', 'installer.module.installed', array('Search_EventHandlers', 'moduleInstall'));
     // Initialisation successful
     return true;
 }
Beispiel #21
0
    public function install(){
        if (!SecurityUtil::checkPermission('Llicencies::', '::', ACCESS_ADMIN)) {
            return LogUtil::registerPermissionError();
        }

        // Crear les taules del mòdul
        if (!DBUtil::createTable('llicencies')||
            !DBUtil::createTable('llicencies_curs')||
            !DBUtil::createTable('llicencies_tema')||
            !DBUtil::createTable('llicencies_subtema')||
            !DBUtil::createTable('llicencies_tipus')||
            !DBUtil::createTable('llicencies_modalitat')||
            !DBUtil::createTable('llicencies_estats') 
            )
            return false;
        ModUtil::setVar($this->name, 'LlicenciesDocRoot', "http://www.xtec.es/sgfp/llicencies/");
        //Successfull
        return true;
    }
Beispiel #22
0
 /**
  * Init ephemerides module
  * @author The Zikula Development Team
  * @return true if init successful, false otherwise
  */
 public function install()
 {
     // create table
     if (!DBUtil::createTable('ephem')) {
         return false;
     }
     // set up module config variables
     $modvars = array('itemsperpage' => 25, 'enablecategorization' => true, 'enablefacebookshare' => false);
     // create our default category
     if (!$this->_createdefaultcategory()) {
         LogUtil::registerStatus($this->{$this}->__('Warning! Could not create the default Ephemerides category tree. If you want to use categorisation with Ephemerides, register at least one property for the module in the Category Registry.'));
         $modvars['enablecategorization'] = false;
     }
     // set up module variables
     ModUtil::setVars('Ephemerides', $modvars);
     // Register hooks
     HookUtil::registerSubscriberBundles($this->version->getHookSubscriberBundles());
     HookUtil::registerProviderBundles($this->version->getHookProviderBundles());
     // initialisation successful
     return true;
 }
Beispiel #23
0
    /**
     * 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;
    }
Beispiel #24
0
    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;
    }
Beispiel #25
0
 /**
  * Initialise the Admin module.
  * This function is only ever called once during the lifetime of a particular
  * module instance
  *
  * @return boolean True if initialisation succcesful, false otherwise.
  */
 public function install()
 {
     if (!DBUtil::createTable('admin_category')) {
         return false;
     }
     if (!DBUtil::createTable('admin_module')) {
         return false;
     }
     $this->setVar('modulesperrow', 3);
     $this->setVar('itemsperpage', 15);
     $this->setVar('defaultcategory', 5);
     $this->setVar('modulestylesheet', 'navtabs.css');
     $this->setVar('admingraphic', 1);
     $this->setVar('startcategory', 1);
     // change below to 0 before release - just makes it easier doing development meantime - drak
     // we can now leave this at 0 since the code also checks the development flag (config.php) - markwest
     $this->setVar('ignoreinstallercheck', 0);
     $this->setVar('admintheme', '');
     $this->setVar('displaynametype', 1);
     $this->defaultdata();
     // Initialisation successful
     return true;
 }
Beispiel #26
0
    /**
     * initialise the template module
     *
     * This function is only ever called once during the lifetime of a particular
     * module instance
     *
     * @return boolean
     */
    public function install()
    {
        // create table
        if (!DBUtil::createTable('pages')) {
            return false;
        }

        // set up config variables
        $modvars = array(
                'itemsperpage' => 25,
                'enablecategorization' => true,
                'addcategorytitletopermalink' => true,
                'showpermalinkinput' => true,
                'def_displaywrapper' => true,
                'def_displaytitle' => true,
                'def_displaycreated' => true,
                'def_displayupdated' => true,
                'def_displaytextinfo' => true,
                'def_displayprint' => true
        );

        // create our default category
        if (!$this->_createdefaultcategory()) {
            LogUtil::registerStatus($this->__('Warning! Could not create the default Pages category tree. If you want to use categorization for the pages, register at least one property for the module in the Category Registry.'));
            $modvars['enablecategorization'] = false;
        }

        // set up module variables
        $this->setVars($modvars);

        HookUtil::registerSubscriberBundles($this->version->getHookSubscriberBundles());
        
        $this->createIntroPage();

        // initialisation successful
        return true;
    }
Beispiel #27
0
    /**
     * initialise the theme module
     *
     * This function is only ever called once during the lifetime of a particular
     * module instance.
     * This function MUST exist in the pninit file for a module
     *
     * @return bool true on success, false otherwise
     */
    public function install()
    {
        // create the table
        if (!DBUtil::createTable('themes')) {
            return false;
        }

        // detect all themes on install
        ModUtil::loadApi('Theme', 'admin', true);
        ModUtil::apiFunc('Theme', 'admin', 'regenerate');

        // define defaults for module vars
        $this->setVar('modulesnocache', '');
        $this->setVar('enablecache', false);
        $this->setVar('compile_check', true);
        $this->setVar('cache_lifetime', 1800);
        $this->setVar('cache_lifetime_mods', 1800);
        $this->setVar('force_compile', false);
        $this->setVar('trimwhitespace', false);
        $this->setVar('maxsizeforlinks', 30);
        $this->setVar('itemsperpage', 25);

        $this->setVar('cssjscombine', false);
        $this->setVar('cssjscompress', false);
        $this->setVar('cssjsminify', false);
        $this->setVar('cssjscombine_lifetime', 3600);

        // View
        $this->setVar('render_compile_check',  true);
        $this->setVar('render_force_compile',  false);
        $this->setVar('render_cache',          true);
        $this->setVar('render_expose_template',false);
        $this->setVar('render_lifetime',       3600);

        // Initialisation successful
        return true;
    }
Beispiel #28
0
 /**
  * initialise the blocks module
  *
  * @return       bool       true on success, false otherwise
  */
 public function install()
 {
     // create blocks table
     // appropriate error message and return
     if (!DBUtil::createTable('blocks')) {
         return false;
     }
     // create userblocks table
     if (!DBUtil::createTable('userblocks')) {
         return false;
     }
     // create block positions table
     if (!DBUtil::createTable('block_positions')) {
         return false;
     }
     // create block placements table
     if (!DBUtil::createTable('block_placements')) {
         return false;
     }
     // Set a default value for a module variable
     $this->setVar('collapseable', 0);
     // Initialisation successful
     return true;
 }
Beispiel #29
0
    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->__('The modul IWmain must be installed. Install it, for install this modul.'));
        }

        // Check if the version needed is correct
        $versionNeeded = '2.0';
        if (!ModUtil::func('IWmain', 'admin', 'checkVersion', array('version' => $versionNeeded))) {
            return false;
        }

        // Create module tables
        if (!DBUtil::createTable('IWqv'))
            return false;
        if (!DBUtil::createTable('IWqv_assignments'))
            return false;
        if (!DBUtil::createTable('IWqv_sections'))
            return false;
        if (!DBUtil::createTable('IWqv_messages'))
            return false;
        if (!DBUtil::createTable('IWqv_messages_read'))
            return false;

        //Create module vars
        ModUtil::setVar('IWqv', 'skins', 'default,infantil,formal');
        ModUtil::setVar('IWqv', 'langs', 'ca,es,en');
        ModUtil::setVar('IWqv', 'maxdelivers', '-1,1,2,3,4,5,10');
        ModUtil::setVar('IWqv', 'basedisturl', 'http://clic.xtec.cat/qv_viewer/dist/html/');

        //Initialization successfull 
        return true;
    }
Beispiel #30
0
 /**
  * create tables
  */
 public function createTables_101()
 {
     if (!DBUtil::createTable('categories_registry')) {
         return false;
     }
     if (!DBUtil::createIndex('idx_categories_registry', 'categories_registry', array('modname', 'table', 'property'))) {
         return false;
     }
     if (!DBUtil::createTable('categories_mapmeta')) {
         return false;
     }
     if (!DBUtil::createIndex('idx_categories_mapmeta', 'categories_mapmeta', 'meta_id')) {
         return false;
     }
     if (!DBUtil::createTable('categories_mapobj')) {
         return false;
     }
     if (!DBUtil::createIndex('idx_categories_mapobj', 'categories_mapobj', array('modname', 'table', 'id', 'idcolumn'))) {
         return false;
     }
     return true;
 }