• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP XCube_Utils类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: update041

 function update041()
 {
     $this->mLog->addReport(_AD_LEGACY_MESSAGE_UPDATE_STARTED);
     //Add Table
     $sqlfileInfo = $this->_mTargetXoopsModule->getInfo('sqlfile');
     $dirname = $this->_mTargetXoopsModule->getVar('dirname');
     $sqlfile = $sqlfileInfo[XOOPS_DB_TYPE];
     $sqlfilepath = XOOPS_MODULE_PATH . '/' . $dirname . '/' . $sqlfile;
     require_once XOOPS_MODULE_PATH . '/legacy/admin/class/Legacy_SQLScanner.class.php';
     $scanner = new Legacy_SQLScanner();
     $scanner->setDB_PREFIX(XOOPS_DB_PREFIX);
     $scanner->setDirname($this->_mTargetXoopsModule->get('dirname'));
     if (!$scanner->loadFile($sqlfilepath)) {
         $this->mLog->addError(XCube_Utils::formatMessage(_AD_LEGACY_ERROR_SQL_FILE_NOT_FOUND, $sqlfile));
         return false;
     }
     $scanner->parse();
     $sqls = $scanner->getSQL();
     $root = XCube_Root::getSingleton();
     $db = $root->mController->getDB();
     foreach ($sqls as $sql) {
         if (strpos($sql, '_message_users') !== false) {
             if (!$db->query($sql)) {
                 $this->mLog->addError($db->error());
                 return false;
             }
         }
     }
     $this->mLog->addReport(_AD_LEGACY_MESSAGE_DATABASE_SETUP_FINISHED);
     //add table
     $this->updatemain();
     return true;
 }
开发者ID:nouphet,项目名称:rata,代码行数:33,代码来源:myUpdater.class.php


示例2: getNewMessage

 public static function getNewMessage(&$arrays)
 {
     $root = XCube_Root::getSingleton();
     if ($root->mContext->mUser->isInRole('Site.RegisteredUser')) {
         $uid = $root->mContext->mXoopsUser->get('uid');
         $modHand = xoops_getmodulehandler('inbox', 'message');
         $num = $modHand->getCountUnreadByFromUid($uid);
         if ($num > 0) {
             $root->mLanguageManager->loadModuleMessageCatalog('message');
             $arrays[] = array('url' => XOOPS_MODULE_URL . '/message/index.php', 'title' => XCube_Utils::formatString(_MD_MESSAGE_NEWMESSAGE, $num));
         }
     }
 }
开发者ID:hiro1173,项目名称:legacy,代码行数:13,代码来源:Preload.class.php


示例3: executeViewIndex

 function executeViewIndex(&$controller, &$xoopsUser, &$render)
 {
     //
     // Because this action's template uses USER message catalog, load it.
     //
     $root =& $controller->mRoot;
     $config_handler =& xoops_gethandler('config');
     $moduleConfigUser =& $config_handler->getConfigsByDirname('user');
     if ($moduleConfigUser['use_ssl'] == 1 && !empty($_POST[$moduleConfigUser['sslpost_name']])) {
         session_id($_POST[$moduleConfigUser['sslpost_name']]);
     }
     $render->setTemplateName("legacy_misc_ssllogin.html");
     $render->setAttribute("message", XCube_Utils::formatString(_MD_LEGACY_MESSAGE_LOGIN_SUCCESS, $xoopsUser->get('uname')));
 }
开发者ID:hiro1173,项目名称:legacy,代码行数:14,代码来源:MiscSslloginAction.class.php


示例4: validateBmodule

 function validateBmodule()
 {
     $bmodule = $this->get('bmodule');
     if (!count($bmodule)) {
         $this->addErrorMessage(_AD_LEGACY_ERROR_BMODULE);
     } else {
         $handler =& xoops_gethandler('module');
         foreach ($this->get('bmodule') as $mid) {
             $module =& $handler->get($mid);
             if ($mid != -1 && $mid != 0 && !is_object($module)) {
                 $this->addErrorMessage(XCube_Utils::formatMessage(_AD_LEGACY_ERROR_OBJECTEXIST, _AD_LEGACY_LANG_BMODULE));
             }
         }
     }
 }
开发者ID:nouphet,项目名称:rata,代码行数:15,代码来源:BlockEditForm.class.php


示例5: preBlockFilter

 function preBlockFilter()
 {
     if (LEGACY_INSTALLERCHECKER_ACTIVE == true && is_dir(XOOPS_ROOT_PATH . "/install")) {
         $root =& XCube_Root::getSingleton();
         $root->mLanguageManager->loadModuleMessageCatalog('legacy');
         $xoopsConfig = $root->mContext->mXoopsConfig;
         require_once XOOPS_ROOT_PATH . '/class/template.php';
         $xoopsTpl = new XoopsTpl();
         $xoopsTpl->assign(array('xoops_sitename' => htmlspecialchars($xoopsConfig['sitename']), 'xoops_themecss' => xoops_getcss(), 'xoops_imageurl' => XOOPS_THEME_URL . '/' . $xoopsConfig['theme_set'] . '/', 'lang_message_confirm' => XCube_Utils::formatMessage(_MD_LEGACY_MESSAGE_INSTALL_COMPLETE_CONFIRM, XOOPS_ROOT_PATH . "/install"), 'lang_message_warning' => XCube_Utils::formatMessage(_MD_LEGACY_MESSAGE_INSTALL_COMPLETE_WARNING, XOOPS_ROOT_PATH . "/install")));
         $xoopsTpl->compile_check = true;
         // @todo filebase template with absolute file path
         $xoopsTpl->display(XOOPS_ROOT_PATH . '/modules/legacy/templates/legacy_install_completed.html');
         exit;
     }
 }
开发者ID:nunoluciano,项目名称:uxcl,代码行数:15,代码来源:InstallerChecker.class.php


示例6: validate

 function validate()
 {
     parent::validate();
     //
     // If htmlbanner is clicked, htmlbanner is requreid.
     //
     if ($this->get('htmlbanner')) {
         if (strlen($this->get('htmlcode')) == 0) {
             $this->addErrorMessage(XCube_Utils::formatString(_AD_LEGACYRENDER_ERROR_REQUIRED, _AD_LEGACYRENDER_LANG_HTMLCODE));
         }
     } else {
         if (strlen($this->get('imageurl')) == 0) {
             $this->addErrorMessage(XCube_Utils::formatString(_AD_LEGACYRENDER_ERROR_REQUIRED, _AD_LEGACYRENDER_LANG_IMAGEURL));
         }
         if (strlen($this->get('clickurl')) == 0) {
             $this->addErrorMessage(XCube_Utils::formatString(_AD_LEGACYRENDER_ERROR_REQUIRED, _AD_LEGACYRENDER_LANG_CLICKURL));
         }
     }
 }
开发者ID:hiro1173,项目名称:legacy,代码行数:19,代码来源:BannerAdminEditForm.class.php


示例7: uninstallPreferenceByOrder

 function uninstallPreferenceByOrder($order, &$module, &$log)
 {
     $handler =& xoops_gethandler('config');
     $criteria = new CriteriaCompo();
     $criteria->add(new Criteria('conf_modid', $module->get('mid')));
     $criteria->add(new Criteria('conf_catid', 0));
     $criteria->add(new Criteria('conf_order', $order));
     $configArr =& $handler->getConfigs($criteria);
     foreach (array_keys($configArr) as $idx) {
         if ($handler->deleteConfig($configArr[$idx])) {
             $log->addReport(XCube_Utils::formatMessage("Delete preference '{0}'.", $configArr[$idx]->get('conf_name')));
         } else {
             $log->addError(XCube_Utils::formatMessage("Could not delete preference '{0}'.", $configArr[$idx]->get('conf_name')));
         }
     }
 }
开发者ID:nunoluciano,项目名称:uxcl,代码行数:16,代码来源:ModuleInstallUtils.class.php


示例8: _saveSmilesImages

 function _saveSmilesImages(&$smilesimages)
 {
     if (count($smilesimages) == 0) {
         return true;
     }
     $smileshandler =& xoops_getmodulehandler('smiles');
     for ($i = 0; $i < count($smilesimages); $i++) {
         $ext_pos = strrpos($smilesimages[$i]['name'], '.');
         if ($ext_pos === false) {
             continue;
         }
         $ext = strtolower(substr($smilesimages[$i]['name'], $ext_pos + 1));
         if (empty($this->mAllowedExts[$ext])) {
             continue;
         }
         $file_name = substr($smilesimages[$i]['name'], 0, $ext_pos);
         $save_file_name = uniqid('smil') . '.' . $ext;
         $filehandle = fopen(XOOPS_UPLOAD_PATH . '/' . $save_file_name, "w");
         if (!$filehandle) {
             $this->_addErrorMessage(XCube_Utils::formatMessage(_AD_LEGACY_ERROR_COULD_NOT_SAVE_SMILES_FILE, $file_name));
             continue;
         }
         if (!@fwrite($filehandle, $smilesimages[$i]['content'])) {
             $this->_addErrorMessage(XCube_Utils::formatMessage(_AD_LEGACY_ERROR_COULD_NOT_SAVE_SMILES_FILE, $file_name));
             @fclose($filehandle);
             continue;
         }
         @fclose($filehandle);
         $smiles =& $smileshandler->create();
         $smiles->set('code', $file_name);
         $smiles->set('emotion', $file_name);
         $smiles->set('smile_url', $save_file_name);
         $smiles->set('display', 1);
         if (!$smileshandler->insert($smiles)) {
             $this->_addErrorMessage(XCube_Utils::formatMessage(_AD_LEGACY_ERROR_COULD_NOT_SAVE_SMILES_FILE, $file_name));
         }
         unset($smiles);
     }
     return true;
 }
开发者ID:nunoluciano,项目名称:uxcl,代码行数:40,代码来源:SmilesUploadAction.class.php


示例9: array

//-- for cache by group
$menu_cache_file = XOOPS_TRUST_PATH . '/cache/theme_' . $theme_name . '_menus_' . SITE_SALT;
// PM
if (is_object(@$xoopsUser)) {
    if (defined('XOOPS_CUBE_LEGACY')) {
        $url = null;
        $root = XCube_Root::getSingleton();
        $service =& $root->mServiceManager->getService('privateMessage');
        if ($service != null) {
            $client =& $root->mServiceManager->createClient($service);
            $url = $client->call('getPmInboxUrl', array('uid' => $root->mContext->mXoopsUser->get('uid')));
            if ($url != null) {
                $xugj_pm_new_count = $client->call('getCountUnreadPM', array('uid' => $root->mContext->mXoopsUser->get('uid')));
                if (intval($xugj_pm_new_count) > 0) {
                    $root->mLanguageManager->loadModuleMessageCatalog('message');
                    $xugj_pm_new_message = XCube_Utils::formatString(_MD_MESSAGE_NEWMESSAGE, $xugj_pm_new_count);
                    $this->assign('xugj_pm_new_message', $xugj_pm_new_message . "<br/><a href='" . $url . "'>" . _MD_MESSAGE_TEMPLATE15 . "</a>");
                }
                $this->assign('xugj_pm_new_count', intval($xugj_pm_new_count));
                $this->assign('xugj_pm_inbox_url', $url);
            }
        } else {
            $pm_handler =& xoops_gethandler('privmessage', true);
            if (is_object($pm_handler)) {
                $criteria = new CriteriaCompo(new Criteria('read_msg', 0));
                $criteria->add(new Criteria('to_userid', $root->mContext->mXoopsUser->get('uid')));
                $this->assign('pm', array(new_messages => $pm_handler->getCount($criteria)));
            }
        }
    } else {
        $pm_handler =& xoops_gethandler('privmessage');
开发者ID:xoops123,项目名称:trendy,代码行数:31,代码来源:xugj_assign_trend.php


示例10: checkLogin

 /**
  * Check the login request through delegates, and set XoopsObject to member
  * property if the login is success.
  * 
  * @access public
  */
 function checkLogin()
 {
     if (!is_object($this->mRoot->mContext->mXoopsUser)) {
         $this->mCheckLogin->call(new XCube_Ref($this->mRoot->mContext->mXoopsUser));
         $this->mRoot->mLanguageManager->loadModuleMessageCatalog('legacy');
         if (is_object($this->mRoot->mContext->mXoopsUser)) {
             // If the current user doesn't bring to any groups, kick out him for XCL's security.
             $t_groups =& $this->mRoot->mContext->mXoopsUser->getGroups();
             if (!is_array($t_groups)) {
                 // exception
                 $this->logout();
                 return;
             } else {
                 if (count($t_groups) == 0) {
                     // exception, too
                     $this->logout();
                     return;
                 }
             }
             // RMV-NOTIFY
             // Perform some maintenance of notification records
             $notification_handler =& xoops_gethandler('notification');
             $notification_handler->doLoginMaintenance($this->mRoot->mContext->mXoopsUser->get('uid'));
             XCube_DelegateUtils::call("Site.CheckLogin.Success", new XCube_Ref($this->mRoot->mContext->mXoopsUser));
             //
             // Fall back process for login success.
             //
             $url = XOOPS_URL;
             if (!empty($_POST['xoops_redirect']) && !strpos(xoops_getrequest('xoops_redirect'), 'register')) {
                 $parsed = parse_url(XOOPS_URL);
                 $url = isset($parsed['scheme']) ? $parsed['scheme'] . '://' : 'http://';
                 if (isset($parsed['host'])) {
                     $url .= isset($parsed['port']) ? $parsed['host'] . ':' . $parsed['port'] . trim(xoops_getrequest('xoops_redirect')) : $parsed['host'] . trim(xoops_getrequest('xoops_redirect'));
                 } else {
                     $url .= xoops_getenv('HTTP_HOST') . trim(xoops_getrequest('xoops_redirect'));
                 }
             }
             $this->executeRedirect($url, 1, XCube_Utils::formatMessage(_MD_LEGACY_MESSAGE_LOGIN_SUCCESS, $this->mRoot->mContext->mXoopsUser->get('uname')));
         } else {
             XCube_DelegateUtils::call("Site.CheckLogin.Fail", new XCube_Ref($this->mRoot->mContext->mXoopsUser));
             //
             // Fall back process for login fail.
             //
             $this->executeRedirect(XOOPS_URL . "/user.php", 1, _MD_LEGACY_ERROR_INCORRECTLOGIN);
         }
     } else {
         $this->executeForward(XOOPS_URL . '/');
     }
 }
开发者ID:nouphet,项目名称:rata,代码行数:55,代码来源:Legacy_Controller.class.php


示例11: formatMessage

 /**
  * @deprecated XCube 1.0 will remove this method.
  * @see XCube_Utils::formatString()
  */
 function formatMessage()
 {
     $arr = func_get_args();
     if (count($arr) == 0) {
         return null;
     } else {
         if (count($arr) == 1) {
             return XCube_Utils::formatString($arr[0]);
         } else {
             if (count($arr) > 1) {
                 $vals = $arr;
                 array_shift($vals);
                 return XCube_Utils::formatString($arr[0], $vals);
             }
         }
     }
 }
开发者ID:nunoluciano,项目名称:uxcl,代码行数:21,代码来源:XCube_Utils.class.php


示例12: validate

 function validate()
 {
     parent::validate();
     $handler =& xoops_getmodulehandler('imagecategory', 'legacy');
     $category =& $handler->get($this->get('imgcat_id'));
     $formFile = $this->get('image_name');
     if ($formFile != null && is_object($category)) {
         //
         // Imagefile width & height check.
         //
         if ($formFile->getWidth() > $category->get('imgcat_maxwidth') || $formFile->getHeight() > $category->get('imgcat_maxheight')) {
             $this->addErrorMessage(XCube_Utils::formatMessage(_AD_LEGACY_ERROR_IMG_SIZE, $category->get('imgcat_maxwidth'), $category->get('imgcat_maxheight')));
         }
         //
         // Check file size
         //
         if ($formFile->getFilesize() > $category->get('imgcat_maxsize')) {
             $this->addErrorMessage(XCube_Utils::formatMessage(_AD_LEGACY_ERROR_IMG_FILESIZE, $category->get('imgcat_maxsize')));
         }
     }
 }
开发者ID:nunoluciano,项目名称:uxcl,代码行数:21,代码来源:ImageUploadForm.class.php


示例13: validateSmile_url

 function validateSmile_url()
 {
     if ($this->_mIsNew && $this->get('smile_url') == null) {
         $this->addErrorMessage(XCube_Utils::formatMessage(_MD_LEGACY_ERROR_REQUIRED, _AD_LEGACY_LANG_SMILE_URL));
     }
 }
开发者ID:nouphet,项目名称:rata,代码行数:6,代码来源:SmilesAdminEditForm.class.php


示例14: _processReport

 function _processReport()
 {
     if (!$this->mLog->hasError()) {
         $this->mLog->add(XCube_Utils::formatMessage(_AD_LEGACY_MESSAGE_UPDATING_MODULE_SUCCESSFUL, $this->_mCurrentXoopsModule->get('name')));
     } else {
         $this->mLog->addError(XCube_Utils::formatMessage(_AD_LEGACY_ERROR_UPDATING_MODULE_FAILURE, $this->_mCurrentXoopsModule->get('name')));
     }
 }
开发者ID:nunoluciano,项目名称:uxcl,代码行数:8,代码来源:ModuleUpdater.class.php


示例15: redirect

 /**
  * リダイレクトする
  * @param XoopsUser $xoopsUser
  */
 public function redirect(XoopsUser $xoopsUser)
 {
     $url = $this->_getRedirectURL();
     $message = XCube_Utils::formatMessage(_MD_LEGACY_MESSAGE_LOGIN_SUCCESS, $xoopsUser->get('uname'));
     $this->mRoot->mController->executeRedirect($url, 1, $message);
 }
开发者ID:nouphet,项目名称:xoopscube-preloads,代码行数:10,代码来源:WhenLoginGoTo.class.php


示例16: setConfValueForInput

 /**
  * Set a config value
  * 
  * @param	mixed   &$value Value
  * @param	bool    $force_slash
  */
 function setConfValueForInput(&$value, $force_slash = false)
 {
     switch ($this->getVar('conf_valuetype')) {
         case 'array':
             if (!is_array($value)) {
                 $value = explode('|', trim($value));
             }
             $this->setVar('conf_value', serialize($value), $force_slash);
             break;
         case 'text':
             $this->setVar('conf_value', trim($value), $force_slash);
             break;
         case 'encrypt':
             $this->setVar('conf_value', XCube_Utils::encrypt(trim($value)), $force_slash);
             break;
         default:
             $this->setVar('conf_value', $value, $force_slash);
             break;
     }
 }
开发者ID:hiro1173,项目名称:legacy,代码行数:26,代码来源:configitem.php


示例17: _setUniqueToGroupUserLink

 function _setUniqueToGroupUserLink()
 {
     $root =& XCube_Root::getSingleton();
     $db =& $root->mController->getDB();
     $table = $db->prefix('groups_users_link');
     // Delete duplicate data.
     $sql = 'SELECT `uid`,`groupid`,COUNT(*) AS c FROM `' . $table . '` GROUP BY `uid`,`groupid` HAVING `c` > 1';
     if ($res = $db->query($sql)) {
         while ($row = $db->fetchArray($res)) {
             $sql = sprintf('DELETE FROM `%s` WHERE `uid` = %d AND `groupid` = %d ORDER BY `linkid` DESC', $table, $row['uid'], $row['groupid']);
             if (!$db->query($sql, $row['c'] - 1)) {
                 $this->mLog->addError(XCube_Utils::formatString(_AD_LEGACY_ERROR_COULD_NOT_DELETE_DUPLICATE_DATA, $table));
                 return;
             }
         }
     }
     // Set unique key.
     $sql = 'ALTER TABLE `' . $table . '` DROP INDEX `groupid_uid`';
     $db->query($sql);
     // ignore sql errors
     $sql = 'ALTER TABLE `' . $table . '` ADD UNIQUE `uid_groupid` (`uid`,`groupid`)';
     if ($db->query($sql)) {
         $this->mLog->addReport(XCube_Utils::formatString(_AD_LEGACY_MESSAGE_SET_UNIQUE_KEY_SUCCESSFUL, $table));
     } else {
         $this->mLog->addError(XCube_Utils::formatString(_AD_LEGACY_ERROR_COULD_NOT_SET_UNIQUE_KEY, $table));
     }
 }
开发者ID:nbuy,项目名称:legacy,代码行数:27,代码来源:Legacy_Updater.class.php


示例18: validateRank

 function validateRank()
 {
     $t_rank = $this->get('rank');
     if ($t_rank > 0) {
         $handler =& xoops_getmodulehandler('ranks', 'user');
         $rank =& $handler->get($t_rank);
         if (!is_object($rank)) {
             $this->addErrorMessage(XCube_Utils::formatString(_MD_USER_ERROR_INJURY, _AD_USER_LANG_RANK));
         } elseif ($rank->get('rank_special') != 1) {
             $this->addErrorMessage(XCube_Utils::formatString(_MD_USER_ERROR_INJURY, _AD_USER_LANG_RANK));
         }
     }
 }
开发者ID:hiro1173,项目名称:legacy,代码行数:13,代码来源:UserAdminEditForm.class.php


示例19: _saveTargetImages

 function _saveTargetImages(&$targetimages, $t_imgcat_id)
 {
     if (count($targetimages) == 0) {
         return true;
     }
     $imgcathandler =& xoops_getmodulehandler('imagecategory', 'legacy');
     $t_category =& $imgcathandler->get($t_imgcat_id);
     $t_category_type = $t_category->get('imgcat_storetype');
     $imagehandler =& xoops_getmodulehandler('image');
     if (strtolower($t_category_type) == "file") {
         for ($i = 0; $i < count($targetimages); $i++) {
             $ext_pos = strrpos($targetimages[$i]['name'], '.');
             if ($ext_pos === false) {
                 continue;
             }
             $ext = strtolower(substr($targetimages[$i]['name'], $ext_pos + 1));
             if (empty($this->mAllowedExts[$ext])) {
                 continue;
             }
             $file_name = substr($targetimages[$i]['name'], 0, $ext_pos);
             $save_file_name = uniqid('img') . '.' . $ext;
             $filehandle = fopen(XOOPS_UPLOAD_PATH . '/' . $save_file_name, "w");
             if (!$filehandle) {
                 $this->_addErrorMessage(XCube_Utils::formatMessage(_AD_LEGACY_ERROR_COULD_NOT_SAVE_IMAGE_FILE, $file_name));
                 continue;
             }
             if (!@fwrite($filehandle, $targetimages[$i]['content'])) {
                 $this->_addErrorMessage(XCube_Utils::formatMessage(_AD_LEGACY_ERROR_COULD_NOT_SAVE_IMAGE_FILE, $file_name));
                 @fclose($filehandle);
                 continue;
             }
             @fclose($filehandle);
             $image =& $imagehandler->create();
             $image->set('image_nicename', $file_name);
             $image->set('image_name', $save_file_name);
             $image->set('image_mimetype', $this->mAllowedExts[$ext]);
             $image->set('image_display', 1);
             $image->set('imgcat_id', $t_imgcat_id);
             if (!$imagehandler->insert($image)) {
                 $this->_addErrorMessage(XCube_Utils::formatMessage(_AD_LEGACY_ERROR_COULD_NOT_SAVE_IMAGE_FILE, $file_name));
             }
             unset($image);
         }
         //end of for
     } elseif (strtolower($t_category_type) == "db") {
         for ($i = 0; $i < count($targetimages); $i++) {
             $ext_pos = strrpos($targetimages[$i]['name'], '.');
             if ($ext_pos === false) {
                 continue;
             }
             $ext = strtolower(substr($targetimages[$i]['name'], $ext_pos + 1));
             if (empty($this->mAllowedExts[$ext])) {
                 continue;
             }
             $file_name = substr($targetimages[$i]['name'], 0, $ext_pos);
             $save_file_name = uniqid('img') . '.' . $ext;
             //
             $image =& $imagehandler->create();
             $image->set('image_nicename', $file_name);
             $image->set('image_name', $save_file_name);
             $image->set('image_mimetype', $this->mAllowedExts[$ext]);
             $image->set('image_display', 1);
             $image->set('imgcat_id', $t_imgcat_id);
             $image->loadImageBody();
             if (!is_object($image->mImageBody)) {
                 $image->mImageBody =& $image->createImageBody();
             }
             $image->mImageBody->set('image_body', $targetimages[$i]['content']);
             if (!$imagehandler->insert($image)) {
                 $this->_addErrorMessage(XCube_Utils::formatMessage(_AD_LEGACY_ERROR_COULD_NOT_SAVE_IMAGE_FILE, $file_name));
             }
             unset($image);
         }
         //end of for
     }
     //end of elseif
     return true;
 }
开发者ID:nunoluciano,项目名称:uxcl,代码行数:78,代码来源:ImageUploadAction.class.php


示例20: updateConfigOrderByInfo

 /**
  * updateConfigOrderByInfo
  * 
  * @param   Legacy_PreferenceInformation  &$info
  * @param   XoopsModule  &$module
  * @param   Legacy_ModuleInstallLog  &$log
  * 
  * @return  bool
  **/
 public static function updateConfigOrderByInfo(&$info, &$module, &$log)
 {
     $configHandler =& Leimg_Utils::getXoopsHandler('config');
     $cri = new CriteriaCompo();
     $cri->add(new Criteria('conf_modid', $module->get('mid')));
     $cri->add(new Criteria('conf_catid', 0));
     $cri->add(new Criteria('conf_name', $info->mName));
     $configs =& $configHandler->getConfigs($cri);
     if (!(count($configs) > 0 && is_object($configs[0]))) {
         $log->addError(_MI_LEIMG_INSTALL_ERROR_CONFIG_NOT_FOUND);
         return false;
     }
     $config =& $configs[0];
     $config->set('conf_order', $info->mOrder);
     if (!$configHandler->insertConfig($config)) {
         $log->addError(XCube_Utils::formatString(_MI_LEIMG_INSTALL_ERROR_CONFIG_UPDATED, $config->get('conf_name')));
         return false;
     }
     return true;
 }
开发者ID:mambax7,项目名称:leimg,代码行数:29,代码来源:LeimgInstallUtils.class.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP XDB类代码示例发布时间:2022-05-23
下一篇:
PHP XCube_Root类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap