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