You are here

public function GatherContentCurl::getProjects in GatherContent 7.2

Get project list.

File

includes/curl.inc, line 156
Contains functions used to process and retrieve data from GatherContent.

Class

GatherContentCurl
@file Contains functions used to process and retrieve data from GatherContent.

Code

public function getProjects() {
  $projects = $this
    ->get('get_projects');
  $newprojects = array();
  if ($projects && is_object($projects) && is_array($projects->projects)) {
    foreach ($projects->projects as $project) {
      $newprojects[$project->id] = array(
        'name' => $project->name,
        'page_count' => $project->page_count,
        'word' => $project->page_count == 1 ? 'page' : 'pages',
      );
    }
    asort($newprojects);
  }
  $this->data['projects'] = $newprojects;
}