+ Get project branches.

This commit is contained in:
dingguodong
2021-08-17 17:44:58 +08:00
parent d23d3adf03
commit 3dc7a2111b
+21
View File
@@ -349,4 +349,25 @@ class gitlab extends control
}
return $this->send($options);
}
/**
* AJAX: Get project branches.
*
* @param int $gitlabID
* @param int $projectID
* @access public
* @return object
*/
public function ajaxGetProjectBranches($gitlabID, $projectID)
{
if(!$gitlabID or !$projectID) return $this->send(array('message' => array()));
$branches = $this->gitlab->apiGetBranches($gitlabID, $projectID);
$options = "<option value=''></option>";
foreach($branches as $index =>$branch)
{
$options .= "<option title='{$branch->name}' value='{$index}' data-name='{$branch->name}'>{$branch->name}</option>";
}
return $this->send($options);
}
}