Exemplo n.º 1
0
	function execute(&$controller, &$xoopsUser)
	{
		if (xoops_getrequest('_form_control_cancel') != null) {
			return USER_FRAME_VIEW_CANCEL;
		}

		$isNew = $this->mObject->isNew();
		
		$ret = parent::execute($controller, $xoopsUser);
		
		if ($ret == USER_FRAME_VIEW_SUCCESS && $isNew) {
			$handler =& xoops_getmodulehandler('users_search');
			$uidArr = $handler->getUids($this->mFilter->getCriteria(0, 0));
			
			$handler =& xoops_getmodulehandler('mailjob_link');
			foreach ($uidArr as $uid) {
				$obj =& $handler->create();
				$obj->set('mailjob_id', $this->mObject->get('mailjob_id'));
				$obj->set('uid', $uid);
				$handler->insert($obj);
			}
		}
		
		return $ret;
	}
Exemplo n.º 2
0
 function executeViewInput(&$controller, &$xoopsUser, &$render)
 {
     $render->setTemplateName("tplfile_clone.html");
     $render->setAttribute('actionForm', $this->mActionForm);
     $render->setAttribute('object', $this->mObject);
     $render->setAttribute('tpl_id', xoops_getrequest('tpl_id'));
 }
Exemplo n.º 3
0
	function _getId()
	{
		$root =& XCube_Root::getSingleton();
		$uid = is_object($root->mContext->mXoopsUser) ? $root->mContext->mXoopsUser->get('uid') : 0;
		
		return isset($_REQUEST['uid']) ? intval(xoops_getrequest('uid')) : $uid;
	}
Exemplo n.º 4
0
 function _setupObject()
 {
     parent::_setupObject();
     if (is_object($this->mObject) && $this->mObject->isNew()) {
         $this->mObject->set('cid', xoops_getrequest('cid'));
     }
 }
Exemplo n.º 5
0
 function fetch()
 {
     parent::fetch();
     $root =& XCube_Root::getSingleton();
     $rank_special = $root->mContext->mRequest->getRequest('rank_special');
     $option_field = $root->mContext->mRequest->getRequest('option_field');
     $search = $root->mContext->mRequest->getRequest('search');
     if (isset($_REQUEST['rank_special'])) {
         $this->mNavi->addExtra('rank_special', xoops_getrequest('rank_special'));
         $this->_mCriteria->add(new Criteria('rank_special', xoops_getrequest('rank_special')));
     }
     if (isset($_REQUEST['option_field'])) {
         $this->mNavi->addExtra('option_field', xoops_getrequest('option_field'));
         $this->mOptionField = $option_field;
         if ($this->mOptionField == "special") {
             //only system avatar
             $this->_mCriteria->add(new Criteria('rank_special', '1'));
         } elseif ($this->mOptionField == "normal") {
             //only custom avatar
             $this->_mCriteria->add(new Criteria('rank_special', '0'));
         } else {
             //all
         }
     }
     //
     if (!empty($search)) {
         $this->mKeyword = $search;
         $this->mNavi->addExtra('search', $this->mKeyword);
         $this->_mCriteria->add(new Criteria('rank_title', '%' . $this->mKeyword . '%', 'LIKE'));
     }
     $this->_mCriteria->addSort($this->getSort(), $this->getOrder());
 }
Exemplo n.º 6
0
 function checkLogin(&$xoopsUser)
 {
     $root =& XCube_Root::getSingleton();
     if ($root->mContext->mUser->isInRole('Site.RegisteredUser')) {
         return;
     }
     $root->mLanguageManager->loadModuleMessageCatalog('user');
     $userHandler =& xoops_getmodulehandler('users', 'user');
     $criteria = new CriteriaCompo();
     if (xoops_getrequest('uname') != "" && strpos(xoops_getrequest('uname'), '@') !== false) {
         $criteria->add(new Criteria('email', xoops_getrequest('uname')));
     } else {
         $criteria->add(new Criteria('uname', xoops_getrequest('uname')));
         // use for both e-mail or uname logiin
         //	$criteria->add(new Criteria('uname',''));				// use for only e-mail logiin
     }
     $criteria->add(new Criteria('pass', md5(xoops_getrequest('pass'))));
     $userArr =& $userHandler->getObjects($criteria);
     if (count($userArr) != 1) {
         return;
     }
     if ($userArr[0]->get('level') == 0) {
         return;
     }
     $handler =& xoops_gethandler('user');
     $user =& $handler->get($userArr[0]->get('uid'));
     $xoopsUser = $user;
     require_once XOOPS_ROOT_PATH . '/include/session.php';
     xoops_session_regenerate();
     $_SESSION = array();
     $_SESSION['xoopsUserId'] = $xoopsUser->get('uid');
     $_SESSION['xoopsUserGroups'] = $xoopsUser->getGroups();
 }
	function execute(&$controller, &$xoopsUser)
	{
		//in case of result of user-search
		if (!isset($_REQUEST['batchjob'])) {
			return $this->getDefaultView($controller, $xoopsUser);
		}

		//To return user to proper-url with search condition 
		$this->mFilter =& $this->_getFilterForm();
		$this->mFilter->fetch();
		//
		if (xoops_getrequest('_form_control_cancel') != null) {
			return USER_FRAME_VIEW_CANCEL;
		}

		$this->mActionForm->fetch();
		$this->mActionForm->validate();

		if ($this->mActionForm->hasError()) {
			return $this->_processConfirm($controller, $xoopsUser);
		}
		else {
			return $this->_processSave($controller, $xoopsUser);
		}

	}
Exemplo n.º 8
0
 function getDefaultView(&$controller, &$xoopsUser)
 {
     $dirname = xoops_getrequest('dirname');
     if (!preg_match("/^[a-zA-Z_][a-zA-Z0-9_]*\$/", $dirname)) {
         return LEGACY_FRAME_VIEW_ERROR;
     }
     if (!is_dir(XOOPS_MODULE_PATH . "/" . $dirname)) {
         return LEGACY_FRAME_VIEW_ERROR;
     }
     $moduleHandler =& xoops_gethandler('module');
     $this->mModuleObject =& $moduleHandler->getByDirname($dirname);
     //
     // If a module is installed, load modinfo and go to special displaying.
     //
     if (is_object($this->mModuleObject)) {
         $this->mModuleObject->loadAdminMenu();
         $this->mModuleObject->loadInfo($dirname);
         $this->mInstalledFlag = true;
     } else {
         $this->mModuleObject =& $moduleHandler->create();
         $this->mModuleObject->loadInfoAsVar($dirname);
         $this->mInstalledFlag = false;
     }
     return LEGACY_FRAME_VIEW_SUCCESS;
 }
 function getDefaultView(&$controller, &$xoopsUser)
 {
     $id = xoops_getrequest('tpl_id');
     $handler =& xoops_getmodulehandler('tplfile');
     $this->mObject =& $handler->get($id);
     return $this->mObject != null ? LEGACYRENDER_FRAME_VIEW_SUCCESS : LEGACYRENDER_FRAME_VIEW_ERROR;
 }
Exemplo n.º 10
0
 function executeViewIndex(&$controller, &$xoopsUser, &$render)
 {
     $render->setTemplateName("legacy_image_list.html");
     foreach (array_keys($this->mObjects) as $key) {
         $this->mObjects[$key]->loadImagecategory();
     }
     $render->setAttribute("objects", $this->mObjects);
     $render->setAttribute("pageNavi", $this->mFilter->mNavi);
     $render->setAttribute('imgcatId', $this->mImgcatId);
     $handler =& xoops_getmodulehandler('imagecategory', 'legacy');
     if (is_object($xoopsUser)) {
         $groups = $xoopsUser->getGroups();
     } else {
         $groups = array(XOOPS_GROUP_ANONYMOUS);
     }
     $categoryArr =& $handler->getObjectsWithReadPerm($groups, 1);
     $render->setAttribute('categoryArr', $categoryArr);
     //
     // If current category object exists, check the permission of uploading.
     //
     $hasUploadPerm = null;
     if ($this->mCategory != null) {
         $hasUploadPerm = $this->mCategory->hasUploadPerm($groups);
     }
     $render->setAttribute('hasUploadPerm', $hasUploadPerm);
     $render->setAttribute("category", $this->mCategory);
     //echo xoops_getrequest('target');die();
     $render->setAttribute('target', htmlspecialchars(xoops_getrequest('target'), ENT_QUOTES));
 }
Exemplo n.º 11
0
	function execute(&$controller, &$xoopsUser)
	{
		if (!is_object($this->mMailjob)) {
			return USER_FRAME_VIEW_ERROR;
		}
		
		if (xoops_getrequest('_form_control_cancel') != null) {
			return USER_FRAME_VIEW_CANCEL;
		}
		
		$this->mActionForm->fetch();
		$this->mActionForm->validate();
		
		if ($this->mActionForm->hasError()) {
			return USER_FRAME_VIEW_INPUT;
		}

		$root =& XCube_Root::getSingleton();
		if ($this->mMailjob->get('is_pm')) {
			$this->mMailjob->mSend->add(array(&$this, "sendPM"));
		}

		if ($this->mMailjob->get('is_mail')) {
			$this->mMailjob->mSend->add(array(&$this, "sendMail"));
		}

		$this->mMailjob->send($xoopsUser);
		
		$this->mMailjob->loadUserCount();
		
		return ($this->mMailjob->mUserCount > 0) ? USER_FRAME_VIEW_INPUT : USER_FRAME_VIEW_SUCCESS;
	}
Exemplo n.º 12
0
 function execute(&$controller, &$xoopsUser)
 {
     if (xoops_getrequest('_form_control_cancel') != null) {
         return LEGACYRENDER_FRAME_VIEW_CANCEL;
     }
     $this->mActionForm->fetch();
     $this->mActionForm->validate();
     if ($this->mActionForm->hasError()) {
         return $this->getDefaultView($controller, $xoopsUser);
     }
     require_once XOOPS_ROOT_PATH . "/class/class.tar.php";
     $tar = new tar();
     $formFile = $this->mActionForm->get('upload');
     //
     // [Warn] access private member directly
     // TODO We should define the access method because we oftern
     //      access private member of XCube_FormFile.
     //
     $tar->openTar($formFile->_mTmpFileName);
     if (!is_array($tar->files)) {
         return LEGACYRENDER_FRAME_VIEW_ERROR;
     }
     $tplsetName = null;
     foreach ($tar->files as $id => $info) {
         $infoArr = explode('/', str_replace("\\", '/', $info['name']));
         $tplsetName = $this->mActionForm->get('tplset_name');
         if ($tplsetName == null) {
             $tplsetName = trim($infoArr[0]);
         }
         if ($tplsetName != null) {
             break;
         }
     }
     //
     // Check tplset name.
     //
     if ($tplsetName == null || preg_match('/[' . preg_quote('\\/:*?"<>|', '/') . ']/', $tplsetName)) {
         $this->_addErrorMessage(_AD_LEGACYRENDER_ERROR_TPLSET_NAME_WRONG);
         return LEGACYRENDER_FRAME_VIEW_ERROR;
     }
     $handler =& xoops_getmodulehandler('tplset');
     if ($handler->getCount(new Criteria('tplset_name', $tplsetName)) != 0) {
         $this->_addErrorMessage(XCube_Utils::formatMessage(_AD_LEGACYRENDER_ERROR_TPLSET_ALREADY_EXISTS, $tplsetName));
         return LEGACYRENDER_FRAME_VIEW_ERROR;
     }
     $tplset =& $handler->create();
     $tplset->set('tplset_name', $tplsetName);
     if (!$handler->insert($tplset)) {
         $this->_addErrorMessage(_AD_LEGACYRENDER_ERROR_COULD_NOT_SAVE_TPLSET);
         return LEGACYRENDER_FRAME_VIEW_ERROR;
     }
     $themeimages = array();
     if (!$this->_fetchTemplateFiles($tar, $tplset, $themeimages)) {
         return LEGACYRENDER_FRAME_VIEW_ERROR;
     }
     if (!$this->_fetchImageset($tar, $tplset, $themeimages)) {
         return LEGACYRENDER_FRAME_VIEW_ERROR;
     }
     return LEGACYRENDER_FRAME_VIEW_SUCCESS;
 }
Exemplo n.º 13
0
	function getDefaultView(&$controller, &$xoopsUser)
	{
		if ((!isset($_REQUEST['actkey'])) || (!$this->mObject)) {
			$controller->executeForward(XOOPS_URL . '/');
		}

		if ($this->mObject->get('actkey') != xoops_getrequest('actkey')) {
			$controller->executeRedirect(XOOPS_URL . '/', 3, _MD_USER_MESSAGE_ACTKEYNOT);
		} 

		if ($this->mObject->get('level') > 0) {
			$controller->executeRedirect(XOOPS_URL . '/user.php', 3, _MD_USER_MESSAGE_ACONTACT);
		}
		
		$this->mObject->set('level', '1');
		
		//
		// Force update with GET request
		//
		$this->mObjectHandler->insert($this->mObject, true);

		if ($this->mConfig['activation_type'] == 2) {
			$builder =new User_RegistAdminCommitMailBuilder();
			$director =new User_UserRegistMailDirector($builder, $this->mObject, $controller->mRoot->mContext->getXoopsConfig(), $this->mConfig);
			$director->contruct();
			$mailer=&$builder->getResult();
			if ($mailer->send()) {
				$controller->executeRedirect(XOOPS_URL . '/', 5, sprintf(_MD_USER_MESSAGE_ACTVMAILOK, $this->mObject->get('uname')));
			} else {
				$controller->executeRedirect(XOOPS_URL . '/', 5, sprintf(_MD_USER_MESSAGE_ACTVMAILNG, $this->mObject->get('uname')));
			}
		} else {
			$controller->executeRedirect(XOOPS_URL . '/user.php', 5, _MD_USER_MESSAGE_ACTLOGIN);
		}
	}
Exemplo n.º 14
0
 function getDefaultView(&$controller, &$xoopsUser)
 {
     $flag = parent::getDefaultView($controller, $xoopsUser);
     if ($flag == LEGACY_FRAME_VIEW_INPUT && $this->_enableCatchImgcat()) {
         $this->mActionForm->set('imgcat_id', xoops_getrequest('imgcat_id'));
     }
     return $flag;
 }
Exemplo n.º 15
0
 function fetch()
 {
     parent::fetch();
     if (isset($_REQUEST['target'])) {
         $this->mNavi->addExtra('target', xoops_getrequest('target'));
     }
     $this->_mCriteria->addSort($this->getSort(), $this->getOrder());
 }
Exemplo n.º 16
0
 function getDefaultView(&$controller, &$xoopsUser)
 {
     $this->mTargetName = trim(xoops_getrequest('target'));
     if ($this->mTargetName == '' || !preg_match('/^[a-zA-Z]\\w*$/', $this->mTargetName)) {
         return LEGACY_FRAME_VIEW_ERROR;
     }
     return parent::getDefaultView($controller, $xoopsUser);
 }
Exemplo n.º 17
0
 function execute()
 {
     $root =& XCube_Root::getSingleton();
     // load message catalog of legacy for _AD_LEGACY_LANG_NO_SETTING, even if the current module is not Legacy.
     $root->mLanguageManager->loadModuleAdminMessageCatalog('legacy');
     //
     $root->mLanguageManager->loadModinfoMessageCatalog('legacy');
     $controller =& $root->mController;
     $user =& $root->mController->mRoot->mContext->mXoopsUser;
     $render =& $this->getRenderTarget();
     $render->setAttribute('legacy_module', 'legacy');
     $this->mCurrentModule =& $controller->mRoot->mContext->mXoopsModule;
     if ($this->mCurrentModule->get('dirname') == 'legacy') {
         if (xoops_getrequest('action') == "help") {
             $moduleHandler =& xoops_gethandler('module');
             $t_module =& $moduleHandler->getByDirname(xoops_gethandler('dirname'));
             if (is_object($t_module)) {
                 $this->mCurrentModule =& $t_module;
             }
         }
     }
     $db =& $controller->getDB();
     $mod = $db->prefix("modules");
     $perm = $db->prefix("group_permission");
     $groups = implode(",", $user->getGroups());
     //
     // Users who are belong to ADMIN GROUP have every permissions, so we have to prepare two kinds of SQL.
     //
     if ($root->mContext->mUser->isInRole('Site.Owner')) {
         $sql = "SELECT DISTINCT mid FROM {$mod} WHERE isactive=1 AND hasadmin=1 ORDER BY weight, mid";
     } else {
         $sql = "SELECT DISTINCT {$mod}.mid FROM {$mod},{$perm} " . "WHERE {$mod}.isactive=1 AND {$mod}.mid={$perm}.gperm_itemid AND {$perm}.gperm_name='module_admin' AND {$perm}.gperm_groupid IN ({$groups}) " . "AND {$mod}.hasadmin=1 " . "ORDER BY {$mod}.weight, {$mod}.mid";
     }
     $result = $db->query($sql);
     $handler =& xoops_gethandler('module');
     while ($row = $db->fetchArray($result)) {
         $xoopsModule =& $handler->get($row['mid']);
         $module =& Legacy_Utils::createModule($xoopsModule);
         $this->mModules[] =& $module;
         unset($module);
     }
     //
     $tpl = $db->prefix("tplfile");
     $tpl_modules = array();
     $sql = "SELECT DISTINCT tpl_module FROM {$tpl}";
     $result = $db->query($sql);
     while ($row = $db->fetchArray($result)) {
         $tpl_modules[] = $row['tpl_module'];
     }
     $render->setAttribute('tplmodules', $tpl_modules);
     //
     $render->setTemplateName('legacy_admin_block_sidemenu.html');
     $render->setAttribute('modules', $this->mModules);
     $render->setAttribute('currentModule', $this->mCurrentModule);
     $renderSystem =& $root->getRenderSystem($this->getRenderSystemName());
     $renderSystem->renderBlock($render);
 }
 function fetch()
 {
     parent::fetch();
     if (isset($_REQUEST['mailjob_id'])) {
         $this->mNavi->addExtra('mailjob_id', xoops_getrequest('mailjob_id'));
         $this->_mCriteria->add(new Criteria('mailjob_id', xoops_getrequest('mailjob_id')));
     }
     $this->_mCriteria->addSort($this->getSort(), $this->getOrder());
 }
Exemplo n.º 19
0
 function fetch()
 {
     parent::fetch();
     $root =& XCube_Root::getSingleton();
     $image_display = $root->mContext->mRequest->getRequest('image_display');
     $imgcat_id = $root->mContext->mRequest->getRequest('imgcat_id');
     $option_field = $root->mContext->mRequest->getRequest('option_field');
     $option_field2 = $root->mContext->mRequest->getRequest('option_field2');
     $search = $root->mContext->mRequest->getRequest('search');
     if (isset($_REQUEST['image_display'])) {
         $this->mNavi->addExtra('image_display', xoops_getrequest('image_display'));
         $this->_mCriteria->add(new Criteria('image_display', xoops_getrequest('image_display')));
     }
     if (isset($_REQUEST['imgcat_id'])) {
         $this->mNavi->addExtra('imgcat_id', xoops_getrequest('imgcat_id'));
         $this->_mCriteria->add(new Criteria('imgcat_id', xoops_getrequest('imgcat_id')));
     }
     if (isset($_REQUEST['option_field'])) {
         $this->mNavi->addExtra('option_field', $option_field);
         $this->mOptionField = $option_field;
         if ($this->mOptionField == "visible") {
             $this->_mCriteria->add(new Criteria('image_display', '1'));
         } elseif ($this->mOptionField == "invisible") {
             $this->_mCriteria->add(new Criteria('image_display', '0'));
         } else {
             //all
         }
     }
     if (isset($_REQUEST['option_field2'])) {
         $this->mNavi->addExtra('option_field2', $option_field2);
         $this->mOptionField2 = $option_field2;
         if ($this->mOptionField2 == "gif") {
             $this->_mCriteria->add(new Criteria('image_mimetype', 'image/gif'));
         } elseif ($this->mOptionField2 == "png") {
             $this->_mCriteria->add(new Criteria('image_mimetype', 'image/png'));
         } elseif ($this->mOptionField2 == "jpeg") {
             $cri = new CriteriaCompo();
             $cri->add(new Criteria('image_mimetype', 'image/jpeg'));
             $cri->add(new Criteria('image_mimetype', 'image/pjpeg'), 'OR');
             $this->_mCriteria->add($cri);
         } else {
             //all
         }
     }
     //
     if (!empty($search)) {
         $this->mKeyword = $search;
         $this->mNavi->addExtra('search', $this->mKeyword);
         $this->_mCriteria->add(new Criteria('image_nicename', '%' . $this->mKeyword . '%', 'LIKE'));
     }
     $this->_mCriteria->addSort($this->getSort(), $this->getOrder());
     /*
     if (abs($this->mSort) != IMAGE_SORT_KEY_IMAGE_WEIGHT) {
     	$this->_mCriteria->addSort($this->mSortKeys[IMAGE_SORT_KEY_IMAGE_WEIGHT], $this->getOrder());
     }
     */
 }
Exemplo n.º 20
0
 function getDefaultView(&$controller, &$xoopsUser)
 {
     $handler =& xoops_getmodulehandler('comment');
     $this->mObject =& $handler->get(xoops_getrequest('com_id'));
     if ($this->mObject == null) {
         return LEGACY_FRAME_VIEW_ERROR;
     }
     return LEGACY_FRAME_VIEW_SUCCESS;
 }
Exemplo n.º 21
0
	function getDefaultView(&$controller, &$xoopsUser)
	{
		$uid = isset($_GET['uid']) ? intval(xoops_getrequest('uid')) : 0;
		
		$handler =& xoops_gethandler('user');
		$this->mObject =& $handler->get($uid);
		
		if (!is_object($this->mObject)) {
			return USER_FRAME_VIEW_ERROR;
		}
		
		$t_rank = xoops_getrank($this->mObject->get('rank'), $this->mObject->get('posts'));
		
		$rankHandler =& xoops_getmodulehandler('ranks', 'user');
		$this->mRankObject =& $rankHandler->get($t_rank['id']);
		
		$root =& $controller->mRoot;
		
		$service =& $root->mServiceManager->getService('privateMessage');
		if ($service != null) {
			$client =& $root->mServiceManager->createClient($service);
			$this->mPmliteURL = $client->call('getPmliteUrl', array('fromUid' => is_object($xoopsUser) ? $xoopsUser->get('uid') : 0, 'toUid' => $uid));
		}
		unset($service);
		
		$service =& $root->mServiceManager->getService("LegacySearch");
		if ($service != null) {
			$this->mSearchResults = array();
			
			$client =& $root->mServiceManager->createClient($service);
			
			$moduleArr = $client->call('getActiveModules', array());
			$uid = $this->mObject->get('uid');
			
			foreach ($moduleArr as $t_module) {

				$params = array('mid' => $t_module['mid'],
								'uid' => $uid,
								'maxhit' => USER_USERINFO_MAXHIT,
								'start' => 0);

				$module = array('name' => $t_module['name'],
								'mid' => $t_module['mid'],
								'results' => $client->call('searchItemsOfUser', $params));

				$nresult = count($module['results']);
				if ($nresult) {
					$module['has_more'] = $nresult >= USER_USERINFO_MAXHIT;
					$this->mSearchResults[] = &$module;
					unset($module);
				}
			}
		}
	
		return USER_FRAME_VIEW_SUCCESS;
	}
Exemplo n.º 22
0
	function executeViewInput(&$controller, &$xoopsUser, &$render)
	{
		$render->setTemplateName("user_default.html");
		$render->setAttribute('allowRegister', $this->_mAllowRegister);
		if (!empty($_GET['xoops_redirect'])) {
			$root =& $controller->mRoot;
    		$textFilter =& $root->getTextFilter();
			$render->setAttribute('redirect_page', xoops_getrequest('xoops_redirect'));
		}
	}
Exemplo n.º 23
0
 function getDefaultView(&$controller, &$xoopsUser)
 {
     $result = parent::getDefaultView($controller, $xoopsUser);
     if ($result == LEGACY_FRAME_VIEW_INDEX) {
         $cat_id = xoops_getrequest('imgcat_id');
         $handler =& xoops_getmodulehandler('imagecategory');
         $this->mCategory =& $handler->get($cat_id);
         if ($this->mCategory == null) {
             $result = LEGACY_FRAME_VIEW_ERROR;
         }
     }
     return $result;
 }
 function getDefaultView(&$controller, &$xoopsUser)
 {
     $dirname = trim(xoops_getrequest('dirname'));
     $installer =& $this->_getInstaller($dirname);
     $this->mModuleObject =& $installer->loadModuleObject($dirname);
     if (!is_object($this->mModuleObject)) {
         $this->mLog =& $installer->getLog();
         return LEGACY_FRAME_VIEW_ERROR;
     }
     $this->mActionForm->load($this->mModuleObject);
     $this->mModuleObject->loadAdminMenu();
     $this->mModuleObject->loadInfo($dirname);
     return LEGACY_FRAME_VIEW_INDEX;
 }
 function fetch()
 {
     parent::fetch();
     if (isset($_REQUEST['name'])) {
         $this->mNavi->addExtra('name', xoops_getrequest('name'));
         // TODO Changet to 'LIKE' (?)
         $this->_mCriteria->add(new Criteria('name', xoops_getrequest('name')));
     }
     if (isset($_REQUEST['contact'])) {
         $this->mNavi->addExtra('contact', xoops_getrequest('contact'));
         // TODO Changet to 'LIKE' (?)
         $this->_mCriteria->add(new Criteria('contact', xoops_getrequest('contact')));
     }
     $this->_mCriteria->addSort($this->getSort(), $this->getOrder());
 }
Exemplo n.º 26
0
 function fetch()
 {
     parent::fetch();
     $this->mNavi->addExtra('target', xoops_getrequest('target'));
     if (isset($_REQUEST['imgcat_id'])) {
         $this->mNavi->addExtra('imgcat_id', xoops_getrequest('imgcat_id'));
         $this->_mCriteria->add(new Criteria('imgcat_id', array(XOBJ_DTYPE_INT, xoops_getrequest('imgcat_id'))));
     } else {
         $this->_mCriteria->add(new Criteria('imgcat_id', 0));
     }
     $this->_mCriteria->add(new Criteria('image_display', 1));
     $this->_mCriteria->addSort($this->getSort(), $this->getOrder());
     if (abs($this->mSort) != IMAGE_SORT_KEY_IMAGE_WEIGHT) {
         $this->_mCriteria->addSort(IMAGE_SORT_KEY_IMAGE_WEIGHT, $this->getOrder());
     }
 }
Exemplo n.º 27
0
 function fetch()
 {
     parent::fetch();
     $root =& XCube_Root::getSingleton();
     $code = $root->mContext->mRequest->getRequest('code');
     $smile_url = $root->mContext->mRequest->getRequest('smile_url');
     $emotion = $root->mContext->mRequest->getRequest('emotion');
     $display = $root->mContext->mRequest->getRequest('display');
     $option_field = $root->mContext->mRequest->getRequest('option_field');
     $search = $root->mContext->mRequest->getRequest('search');
     if (isset($_REQUEST['code'])) {
         $this->mNavi->addExtra('code', xoops_getrequest('code'));
         $this->_mCriteria->add(new Criteria('code', xoops_getrequest('code')));
     }
     if (isset($_REQUEST['smile_url'])) {
         $this->mNavi->addExtra('smile_url', xoops_getrequest('smile_url'));
         $this->_mCriteria->add(new Criteria('smile_url', xoops_getrequest('smile_url')));
     }
     if (isset($_REQUEST['emotion'])) {
         $this->mNavi->addExtra('emotion', xoops_getrequest('emotion'));
         $this->_mCriteria->add(new Criteria('emotion', xoops_getrequest('emotion')));
     }
     if (isset($_REQUEST['display'])) {
         $this->mNavi->addExtra('display', xoops_getrequest('display'));
         $this->_mCriteria->add(new Criteria('display', xoops_getrequest('display')));
     }
     if (isset($_REQUEST['option_field'])) {
         $this->mNavi->addExtra('option_field', xoops_getrequest('option_field'));
         $this->mOptionField = $option_field;
         if ($this->mOptionField == "visible") {
             $this->_mCriteria->add(new Criteria('display', '1'));
         } elseif ($this->mOptionField == "invisible") {
             $this->_mCriteria->add(new Criteria('display', '0'));
         } else {
             //all
         }
     }
     //
     if (!empty($search)) {
         $this->mKeyword = $search;
         $this->mNavi->addExtra('search', $this->mKeyword);
         $search_criteria = new CriteriaCompo(new Criteria('code', '%' . $this->mKeyword . '%', 'LIKE'));
         $search_criteria->add(new Criteria('emotion', '%' . $this->mKeyword . '%', 'LIKE'), $condition = 'OR');
         $this->_mCriteria->add($search_criteria);
     }
     $this->_mCriteria->addSort($this->getSort(), $this->getOrder());
 }
Exemplo n.º 28
0
 /**
  * @public
  */
 function execute()
 {
     if ($this->mObject == null) {
         return PROFILE_FRAME_VIEW_ERROR;
     }
     if (xoops_getrequest('_form_control_cancel') != null) {
         return PROFILE_FRAME_VIEW_CANCEL;
     }
     $this->mActionForm->load($this->mObject);
     $this->mActionForm->fetch();
     $this->mActionForm->validate();
     if ($this->mActionForm->hasError()) {
         return PROFILE_FRAME_VIEW_INPUT;
     }
     $this->mActionForm->update($this->mObject);
     return $this->_doExecute($this->mObject);
 }
Exemplo n.º 29
0
 function execute(&$controller, &$xoopsUser)
 {
     if ($this->mObject == null) {
         return USER_FRAME_VIEW_ERROR;
     }
     if (xoops_getrequest('_form_control_cancel') != null) {
         return USER_FRAME_VIEW_CANCEL;
     }
     $this->mActionForm->load($this->mObject);
     $this->mActionForm->fetch();
     $this->mActionForm->validate();
     if ($this->mActionForm->hasError()) {
         return USER_FRAME_VIEW_INPUT;
     }
     $this->mActionForm->update($this->mObject);
     return $this->_doExecute($this->mObject) ? USER_FRAME_VIEW_SUCCESS : USER_FRAME_VIEW_ERROR;
 }
Exemplo n.º 30
0
 function fetch()
 {
     parent::fetch();
     if (isset($_REQUEST['groupid'])) {
         $this->mNavi->addExtra('groupid', xoops_getrequest('groupid'));
         $this->_mCriteria->add(new Criteria('groupid', xoops_getrequest('groupid')));
     }
     if (isset($_REQUEST['name'])) {
         $this->mNavi->addExtra('name', xoops_getrequest('name'));
         $this->_mCriteria->add(new Criteria('name', xoops_getrequest('name')));
     }
     if (isset($_REQUEST['group_type'])) {
         $this->mNavi->addExtra('group_type', xoops_getrequest('group_type'));
         $this->_mCriteria->add(new Criteria('group_type', xoops_getrequest('group_type')));
     }
     $this->_mCriteria->addSort($this->getSort(), $this->getOrder());
 }