本文整理匯總了PHP中Summit::getSubSummits方法的典型用法代碼示例。如果您正苦於以下問題:PHP Summit::getSubSummits方法的具體用法?PHP Summit::getSubSummits怎麽用?PHP Summit::getSubSummits使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Summit
的用法示例。
在下文中一共展示了Summit::getSubSummits方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: executeGetroutes
/**
* returns a list of associated routes
*/
public function executeGetroutes()
{
$id = $this->getRequestParameter('summit_id');
$div_name = $this->getRequestParameter('div_name');
$div_prefix = $this->getRequestParameter('div_prefix', '');
$div_id = $div_prefix . $div_name;
$user = $this->getUser();
$user_id = $user->getId();
// if id = 0 or no provided
if (!$id) {
return $this->ajax_feedback('Missing id parameter');
}
// if session is time-over
if (!$user_id) {
return $this->ajax_feedback('Your session is over. Please login again.');
}
$summit = Document::find('Summit', $id, array('id', 'elevation'));
if (!$summit) {
return $this->ajax_feedback('Summit not found');
}
$sub_summits = Summit::getSubSummits($id);
$ids = array($id);
foreach ($sub_summits as $sub) {
$ids[] = $sub['id'];
}
$routes = Association::findLinkedDocsWithBestName($ids, $this->getUser()->getCulturesForDocuments(), 'sr');
$routes = Route::addBestSummitName($routes, $this->__(' :') . ' ');
$routes = c2cTools::sortArrayByName($routes);
if (count($routes) == 0) {
return $this->ajax_feedback($this->__('No associated route found'));
}
if (!$div_id) {
return $this->ajax_feedback('Please chose a "select" container ID in "remote_function"');
}
$output = $this->__('Route:') . ' <select id="' . $div_id . '" name="' . $div_name . '" onchange="C2C.getWizardRouteRatings(\'' . $div_id . '\');">';
foreach ($routes as $route) {
$output .= '<option value="' . $route['id'] . '">' . $route['name'] . '</option>';
}
$output .= '</select>';
$output .= '<p id="wizard_' . $div_id . '_descr" class="short_descr" style="display: none">' . '<span id="' . $div_id . '_descr">' . $this->__('Short description: ') . $this->__('not available') . '</span></p>';
return $this->renderText($output);
}