當前位置: 首頁>>代碼示例>>PHP>>正文


PHP FileSet::Load方法代碼示例

本文整理匯總了PHP中FileSet::Load方法的典型用法代碼示例。如果您正苦於以下問題:PHP FileSet::Load方法的具體用法?PHP FileSet::Load怎麽用?PHP FileSet::Load使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在FileSet的用法示例。


在下文中一共展示了FileSet::Load方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: file_sets_edit

	public function file_sets_edit(){
		extract($this->getHelperObjects());
		Loader::model('file_set');
		//do my editing
		if (!$validation_token->validate("file_sets_edit")) {			
			$this->set('error', array($validation_token->getErrorMessage()));
			$this->view();
			return;
		}
		
		if(!$this->post('fsID')){
			$this->set('error', array(t('Invalid ID')));
			$this->view();			
		}

		$file_set = new FileSet();
		$file_set->Load('fsID = ?', $this->post('fsID'));		
		$file_set->fsName = $this->post('file_set_name');
		$copyPermissionsFromBase = false;
		if ($file_set->fsOverrideGlobalPermissions == 0 && $this->post('fsOverrideGlobalPermissions') == 1) {
			// we are checking the checkbox for the first time
			$copyPermissionsFromBase = true;
		}		
		if ($file_set->fsOverrideGlobalPermissions) {
			$permissions = PermissionKey::getList('file_set');
			foreach($permissions as $pk) {
				$pk->setPermissionObject($file_set);
				$pt = $pk->getPermissionAssignmentObject();
				$paID = $_POST['pkID'][$pk->getPermissionKeyID()];
				$pt->clearPermissionAssignment();
				if ($paID > 0) {
					$pa = PermissionAccess::getByID($paID, $pk);
					if (is_object($pa)) {
						$pt->assignPermissionAccess($pa);
					}			
				}		
			}			
		}
		$file_set->fsOverrideGlobalPermissions = ($this->post('fsOverrideGlobalPermissions') == 1) ? 1 : 0;
		$file_set->save();
		
		parse_str($this->post('fsDisplayOrder'));
		$file_set->updateFileSetDisplayOrder($fID);

		if ($file_set->fsOverrideGlobalPermissions == 0) {
			$file_set->resetPermissions();		
		} 		
		if ($copyPermissionsFromBase) {
			$file_set->acquireBaseFileSetPermissions();
		}

		$this->redirect("/dashboard/files/sets", 'view_detail', $this->post('fsID'), 'file_set_updated');
	}
開發者ID:nveid,項目名稱:concrete5,代碼行數:53,代碼來源:sets.php

示例2: file_sets_edit

 public function file_sets_edit()
 {
     extract($this->getHelperObjects());
     Loader::model('file_set');
     //do my editing
     if (!$validation_token->validate("file_sets_edit")) {
         $this->set('error', array($validation_token->getErrorMessage()));
         $this->view();
         return;
     }
     if (!$this->post('fsID')) {
         $this->set('error', array(t('Invalid ID')));
         $this->view();
     }
     $file_set = new FileSet();
     $file_set->Load('fsID = ?', $this->post('fsID'));
     $file_set->fsName = $this->post('file_set_name');
     $file_set->fsOverrideGlobalPermissions = $this->post('fsOverrideGlobalPermissions') == 1 ? 1 : 0;
     $file_set->save();
     $file_set->resetPermissions();
     if ($file_set->fsOverrideGlobalPermissions == 1) {
         $p = $this->post();
         $fh = Loader::controller('/dashboard/files/access');
         $fh->setFileSetPermissions($file_set, $p);
     }
     $this->set('message', t('Changes Saved'));
     $this->view();
 }
開發者ID:VonUniGE,項目名稱:concrete5-1,代碼行數:28,代碼來源:sets.php


注:本文中的FileSet::Load方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。