本文整理汇总了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');
}
示例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();
}