Esempio n. 1
0
 $cols = $rex->getStruct();
 if (!isset($cols['sitellite_startdate'])) {
     // no scheduling in this collection
     continue;
 }
 $pkcol = $rex->key;
 foreach ($states as $fromState => $state) {
     $toState = $state['to'];
     $find = array('sitellite_status' => new rEqual('sitellite_status', $fromState));
     if (!empty($state['sitellite_startdate'])) {
         $find['sitellite_startdate'] = new rLiteral($state['sitellite_startdate']);
     }
     if (!empty($state['sitellite_expirydate'])) {
         $find['sitellite_expiry'] = new rLiteral($state['sitellite_expirydate']);
     }
     $list =& $rex->getStoreList($find);
     if (!$list) {
         // no results
         continue;
     }
     // got the list
     foreach (array_keys($list) as $k) {
         $record =& $list[$k];
         // set sitellite_status to $toState
         $upd['sitellite_status'] = $toState;
         $action = $rex->determineAction($record->{$pkcol}, $toState);
         if (!$rex->{$action}($record->{$pkcol}, $upd, $state['msg'])) {
             echo $table . '/' . $record->{$pkcol} . ' (' . $record->sitellite_status . ', ' . $toState . ') - ' . $rex->error . NEWLINE;
         }
     }
 }
Esempio n. 2
0
            }
        }
    }
}
foreach ($rex->info as $key => $vals) {
    if (strpos($key, 'browse:') === 0) {
        $key = substr($key, 7);
        $data['headers'][] = new TableHeader($key, $vals['header']);
        $data['fields'][$key] = $vals;
        if (isset($vals['filter_import'])) {
            loader_import($vals['filter_import']);
        }
    }
}
if ($rex->isVersioned) {
    $res = $rex->getStoreList($acl, $limit, $cgi->offset, $cgi->orderBy, $cgi->sort);
} else {
    $res = $rex->getList($acl, $limit, $cgi->offset, $cgi->orderBy, $cgi->sort);
}
if (!$res) {
    $res = array();
    $rex->total = 0;
}
$pg->total = $rex->total;
$rex->ignore(array('_msg'));
/*
if (isset ($rex->info['Collection']['key_field_name'])) {
	$data['headers'][] = new TableHeader ($rex->info['Collection']['key_field'], $rex->info['Collection']['key_field_name']);
	if (isset ($rex->info['Collection']['key_field_align'])) {
		$data['key_field_align'] = $rex->info['Collection']['key_field_align'];
	}
Esempio n. 3
0
     // keywords and description, but not the body)
     // future: use sitesearch for body searching?
     global $cgi;
     $cgi->_keywords = $parameters['query'];
     // we'll add a few more checks for permissions to the search params as well
     $params = array();
     $acl_list = session_allowed_access_list();
     if (!in_array('all', $acl_list)) {
         $params['sitellite_access'] = new rList('sitellite_access', session_allowed_access_list());
     }
     $team_list = session_allowed_teams_list();
     if (!in_array('all', $team_list)) {
         $params['sitellite_team'] = new rList('sitellite_team', $team_list);
     }
     // perform the search
     $res = $rex->getStoreList($params);
     // build the result object
     $out = new StdClass();
     $out->query = $parameters['query'];
     $out->results = count($res);
     $out->files = array();
     foreach ($res as $row) {
         $info = $rex->getCurrent($row->name);
         unset($info->body);
         $out->files[] = (object) array('type' => mime($info->name), 'name' => '/' . $info->name, 'size' => $info->filesize, 'created' => $info->date_created, 'modified' => $info->last_modified, 'keywords' => $info->keywords, 'description' => $info->description, 'access' => $info->sitellite_access, 'status' => $info->sitellite_status, 'team' => $info->sitellite_team, 'owner' => $info->sitellite_owner, 'lock' => webfiles_lock($info->name));
     }
     webfiles_response($out);
     break;
 case 'lock':
     $path = webfiles_request();
     if (!file_exists($prefix . $path)) {