当前位置: 首页>>代码示例>>PHP>>正文


PHP Vtiger_Package::isLanguageType方法代码示例

本文整理汇总了PHP中Vtiger_Package::isLanguageType方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Package::isLanguageType方法的具体用法?PHP Vtiger_Package::isLanguageType怎么用?PHP Vtiger_Package::isLanguageType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Vtiger_Package的用法示例。


在下文中一共展示了Vtiger_Package::isLanguageType方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: importUserModuleStep2

 public function importUserModuleStep2(Vtiger_Request $request)
 {
     $viewer = $this->getViewer($request);
     $uploadDir = Settings_ModuleManager_Module_Model::getUploadDirectory();
     $qualifiedModuleName = $request->getModule(false);
     $uploadFile = 'usermodule_' . time() . '.zip';
     $uploadFileName = "{$uploadDir}/{$uploadFile}";
     $error = '';
     checkFileAccess($uploadDir);
     if (!move_uploaded_file($_FILES['moduleZip']['tmp_name'], $uploadFileName)) {
         $error = 'LBL_ERROR_MOVE_UPLOADED_FILE';
     } else {
         $package = new Vtiger_Package();
         $importModuleName = $package->getModuleNameFromZip($uploadFileName);
         $importModuleDepVtVersion = $package->getDependentVtigerVersion();
         if ($importModuleName == null) {
             $error = $package->_errorText;
             checkFileAccessForDeletion($uploadFileName);
             unlink($uploadFileName);
         } else {
             // We need these information to push for Update if module is detected to be present.
             $moduleLicence = vtlib_purify($package->getLicense());
             $viewer->assign("MODULEIMPORT_FILE", $uploadFile);
             $viewer->assign("MODULEIMPORT_TYPE", $package->type());
             $viewer->assign("MODULEIMPORT_NAME", $importModuleName);
             $viewer->assign("MODULEIMPORT_DEP_VTVERSION", $importModuleDepVtVersion);
             $viewer->assign("MODULEIMPORT_LICENSE", $moduleLicence);
             if (!$package->isLanguageType() && !$package->isUpdateType() && !$package->isModuleBundle()) {
                 $moduleInstance = Vtiger_Module::getInstance($importModuleName);
                 $moduleimport_exists = $moduleInstance ? "true" : "false";
                 $moduleimport_dir_name = "modules/{$importModuleName}";
                 $moduleimport_dir_exists = is_dir($moduleimport_dir_name) ? "true" : "false";
                 $viewer->assign("MODULEIMPORT_EXISTS", $moduleimport_exists);
                 $viewer->assign("MODULEIMPORT_DIR", $moduleimport_dir_name);
                 $viewer->assign("MODULEIMPORT_DIR_EXISTS", $moduleimport_dir_exists);
             }
         }
     }
     $viewer->assign('MODULEIMPORT_ERROR', $error);
     $viewer->view('ImportUserModuleStep2.tpl', $qualifiedModuleName);
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:41,代码来源:ModuleImport.php

示例2: updateVtlibModule

function updateVtlibModule($module, $packagepath)
{
    global $log, $_installOrUpdateVtlibModule;
    if (!file_exists($packagepath)) {
        return;
    }
    if (isset($_installOrUpdateVtlibModule[$module . $packagepath])) {
        return;
    }
    $_installOrUpdateVtlibModule[$module . $packagepath] = 'update';
    require_once 'vtlib/Vtiger/Package.php';
    require_once 'vtlib/Vtiger/Module.php';
    $Vtiger_Utils_Log = defined('INSTALLATION_MODE_DEBUG') ? INSTALLATION_MODE_DEBUG : true;
    $package = new Vtiger_Package();
    if ($package->isLanguageType($packagepath)) {
        require_once 'vtlib/Vtiger/Language.php';
        $languagePack = new Vtiger_Language();
        $languagePack->update(null, $packagepath, true);
        return;
    }
    if ($module == null) {
        $log->fatal("Module name is invalid");
    } else {
        $moduleInstance = Vtiger_Module::getInstance($module);
        if ($moduleInstance || $package->isModuleBundle($packagepath)) {
            $log->debug("{$module} - Module instance found - Update starts here");
            $package->update($moduleInstance, $packagepath);
        } else {
            $log->fatal("{$module} doesn't exists!");
        }
    }
}
开发者ID:yunter,项目名称:crm,代码行数:32,代码来源:utils.php

示例3: updateVtlibModule

function updateVtlibModule($module, $packagepath)
{
    global $log;
    require_once 'vtlib/Vtiger/Package.php';
    require_once 'vtlib/Vtiger/Module.php';
    $Vtiger_Utils_Log = true;
    $package = new Vtiger_Package();
    if ($package->isLanguageType($packagepath)) {
        require_once 'vtlib/Vtiger/Language.php';
        $languagePack = new Vtiger_Language();
        $languagePack->update(null, $packagepath, true);
        return;
    }
    if ($module == null) {
        $log->fatal("Module name is invalid");
    } else {
        $moduleInstance = Vtiger_Module::getInstance($module);
        if ($moduleInstance || $package->isModuleBundle($packagepath)) {
            $log->debug("{$module} - Module instance found - Update starts here");
            $package->update($moduleInstance, $packagepath);
        } else {
            $log->fatal("{$module} doesn't exists!");
        }
    }
}
开发者ID:jgjermeni,项目名称:corebos,代码行数:25,代码来源:utils.php

示例4: installSelectedOptionalModules

 public static function installSelectedOptionalModules($selected_modules, $source_directory = '', $destination_directory = '')
 {
     require_once 'vtlib/Vtiger/Package.php';
     require_once 'vtlib/Vtiger/Module.php';
     require_once 'include/utils/utils.php';
     $selected_modules = explode(":", $selected_modules);
     $languagePacks = array();
     if ($handle = opendir('packages/vtiger/optional')) {
         while (false !== ($file = readdir($handle))) {
             $filename_arr = explode(".", $file);
             if ($filename_arr[count($filename_arr) - 1] != 'zip') {
                 continue;
             }
             $packagename = $filename_arr[0];
             $packagepath = "packages/vtiger/optional/{$file}";
             $package = new Vtiger_Package();
             $module = $package->getModuleNameFromZip($packagepath);
             if (!empty($packagename) && in_array($module, $selected_modules)) {
                 if ($package->isLanguageType($packagepath)) {
                     $languagePacks[$module] = $packagepath;
                     continue;
                 }
                 if ($module != null) {
                     if ($package->isModuleBundle()) {
                         $unzip = new Vtiger_Unzip($packagepath);
                         $unzip->unzipAllEx($package->getTemporaryFilePath());
                         $moduleInfoList = $package->getAvailableModuleInfoFromModuleBundle();
                         foreach ($moduleInfoList as $moduleInfo) {
                             $moduleInfo = (array) $moduleInfo;
                             $packagepath = $package->getTemporaryFilePath($moduleInfo['filepath']);
                             $subModule = new Vtiger_Package();
                             $subModuleName = $subModule->getModuleNameFromZip($packagepath);
                             $moduleInstance = Vtiger_Module::getInstance($subModuleName);
                             if ($moduleInstance) {
                                 updateVtlibModule($subModuleName, $packagepath);
                             } else {
                                 installVtlibModule($subModuleName, $packagepath);
                             }
                         }
                     } else {
                         $moduleInstance = Vtiger_Module::getInstance($module);
                         if ($moduleInstance) {
                             updateVtlibModule($module, $packagepath);
                         } else {
                             installVtlibModule($module, $packagepath);
                         }
                     }
                 }
             }
         }
         closedir($handle);
     }
     foreach ($languagePacks as $module => $packagepath) {
         installVtlibModule($module, $packagepath);
         continue;
     }
 }
开发者ID:hbsman,项目名称:vtigercrm-5.3.0-ja,代码行数:57,代码来源:utils.php

示例5: mkdir

 if (!is_dir($modulemanager_uploaddir)) {
     mkdir($modulemanager_uploaddir);
 }
 $uploadfile = "usermodule_" . time() . ".zip";
 $uploadfilename = "{$modulemanager_uploaddir}/{$uploadfile}";
 checkFileAccess($modulemanager_uploaddir);
 if (!move_uploaded_file($_FILES['module_zipfile']['tmp_name'], $uploadfilename)) {
     $smarty->assign("MODULEIMPORT_FAILED", "true");
 } else {
     $package = new Vtiger_Package();
     $moduleimport_name = $package->getModuleNameFromZip($uploadfilename);
     if ($moduleimport_name == null) {
         $smarty->assign("MODULEIMPORT_FAILED", "true");
         $smarty->assign("MODULEIMPORT_FILE_INVALID", "true");
     } else {
         if (!$package->isLanguageType()) {
             $moduleInstance = Vtiger_Module::getInstance($moduleimport_name);
             $moduleimport_exists = $moduleInstance ? "true" : "false";
             $moduleimport_dir_name = "modules/{$moduleimport_name}";
             $moduleimport_dir_exists = is_dir($moduleimport_dir_name) ? "true" : "false";
             $smarty->assign("MODULEIMPORT_EXISTS", $moduleimport_exists);
             $smarty->assign("MODULEIMPORT_DIR", $moduleimport_dir_name);
             $smarty->assign("MODULEIMPORT_DIR_EXISTS", $moduleimport_dir_exists);
         }
         $moduleimport_dep_vtversion = $package->getDependentVtigerVersion();
         $moduleimport_license = $package->getLicense();
         $smarty->assign("MODULEIMPORT_FILE", $uploadfile);
         $smarty->assign("MODULEIMPORT_TYPE", $package->type());
         $smarty->assign("MODULEIMPORT_NAME", $moduleimport_name);
         $smarty->assign("MODULEIMPORT_DEP_VTVERSION", $moduleimport_dep_vtversion);
         $smarty->assign("MODULEIMPORT_LICENSE", $moduleimport_license);
开发者ID:hbsman,项目名称:vtigercrm-5.3.0-ja,代码行数:31,代码来源:Import.php

示例6: substr

     }
     $newEntryName = substr($entryName, $firstSlash + 1);
     if ($newEntryName !== false) {
         $za->renameIndex($i, $newEntryName);
     } else {
         $za->deleteIndex($i);
     }
 }
 $za->close();
 $package = new Vtiger_Package();
 $moduleimport_name = $package->getModuleNameFromZip($uploadfilename);
 if ($moduleimport_name == null) {
     $smarty->assign("MODULEIMPORT_FAILED", "true");
     $smarty->assign("MODULEIMPORT_FILE_INVALID", "true");
 } else {
     if (!$package->isLanguageType() && !$package->isModuleBundle()) {
         $moduleInstance = Vtiger_Module::getInstance($moduleimport_name);
         $moduleimport_exists = $moduleInstance ? "true" : "false";
         $moduleimport_dir_name = "modules/{$moduleimport_name}";
         $moduleimport_dir_exists = is_dir($moduleimport_dir_name) ? "true" : "false";
         $smarty->assign("MODULEIMPORT_EXISTS", $moduleimport_exists);
         $smarty->assign("MODULEIMPORT_DIR", $moduleimport_dir_name);
         $smarty->assign("MODULEIMPORT_DIR_EXISTS", $moduleimport_dir_exists);
     }
     $moduleimport_dep_vtversion = $package->getDependentVtigerVersion();
     $moduleimport_license = $package->getLicense();
     $smarty->assign("MODULEIMPORT_FILE", $uploadfile);
     $smarty->assign("MODULEIMPORT_TYPE", $package->type());
     $smarty->assign("MODULEIMPORT_NAME", $moduleimport_name);
     $smarty->assign("MODULEIMPORT_DEP_VTVERSION", $moduleimport_dep_vtversion);
     $smarty->assign("MODULEIMPORT_LICENSE", $moduleimport_license);
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:31,代码来源:Import.php

示例7: substr

     }
     $newEntryName = substr($entryName, $firstSlash + 1);
     if ($newEntryName !== false) {
         $za->renameIndex($i, $newEntryName);
     } else {
         $za->deleteIndex($i);
     }
 }
 $za->close();
 $package = new Vtiger_Package();
 $moduleupdate_name = $package->getModuleNameFromZip($uploadfilename);
 if ($moduleupdate_name == null) {
     $smarty->assign("MODULEUPDATE_FAILED", "true");
     $smarty->assign("MODULEUPDATE_FILE_INVALID", "true");
 } else {
     if (!$package->isLanguageType() && $moduleupdate_name != $target_modulename) {
         $smarty->assign("MODULEUPDATE_FAILED", "true");
         $smarty->assign("MODULEUPDATE_NAME_MISMATCH", "true");
     } else {
         if ($package->isLanguageType() && trim($package->xpath_value('prefix')) != $target_modulename) {
             $smarty->assign("MODULEUPDATE_FAILED", "true");
             $smarty->assign("MODULEUPDATE_NAME_MISMATCH", "true");
         } else {
             $moduleupdate_dep_vtversion = $package->getDependentVtigerVersion();
             $moduleupdate_license = $package->getLicense();
             $moduleupdate_version = $package->getVersion();
             if (!$package->isLanguageType()) {
                 $moduleInstance = Vtiger_Module::getInstance($moduleupdate_name);
                 $moduleupdate_exists = $moduleInstance ? "true" : "false";
                 $moduleupdate_dir_name = "modules/{$moduleupdate_name}";
                 $moduleupdate_dir_exists = is_dir($moduleupdate_dir_name) ? "true" : "false";
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:31,代码来源:Update.php

示例8: installVtlibModule

function installVtlibModule($packagename, $packagepath, $customized = false)
{
    global $log;
    require_once 'vtlib/Vtiger/Package.php';
    require_once 'vtlib/Vtiger/Module.php';
    $Vtiger_Utils_Log = true;
    $package = new Vtiger_Package();
    if ($package->isLanguageType($packagepath)) {
        $package = new Vtiger_Language();
        $package->import($packagepath, true);
        return;
    }
    $module = $package->getModuleNameFromZip($packagepath);
    $module_exists = false;
    $module_dir_exists = false;
    if ($module == null) {
        $log->fatal("{$packagename} Module zipfile is not valid!");
    } else {
        if (Vtiger_Module::getInstance($module)) {
            $log->fatal("{$module} already exists!");
            $module_exists = true;
        }
    }
    if ($module_exists == false) {
        $log->debug("{$module} - Installation starts here");
        $package->import($packagepath, true);
        $moduleInstance = Vtiger_Module::getInstance($module);
        if (empty($moduleInstance)) {
            $log->fatal("{$module} module installation failed!");
        }
    }
}
开发者ID:latechdirect,项目名称:vtiger,代码行数:32,代码来源:utils.php


注:本文中的Vtiger_Package::isLanguageType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。