当前位置: 首页>>代码示例>>PHP>>正文


PHP api_get_jqgrid_js函数代码示例

本文整理汇总了PHP中api_get_jqgrid_js函数的典型用法代码示例。如果您正苦于以下问题:PHP api_get_jqgrid_js函数的具体用法?PHP api_get_jqgrid_js怎么用?PHP api_get_jqgrid_js使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了api_get_jqgrid_js函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: questionsAction

 /**
  * Index of the question manager
  * @param Application $app
  * @return Response
  *
  */
 public function questionsAction(Application $app)
 {
     $extraJS = array();
     //@todo improve this JS includes should be added using twig
     $extraJS[] = api_get_jqgrid_js();
     $app['extraJS'] = $extraJS;
     // Getting CQuizCategory repo.
     /** @var \Gedmo\Tree\Entity\Repository\NestedTreeRepository $repo */
     $repo = $app['orm.em']->getRepository('Entity\\CQuizCategory');
     $categoryId = $app['request']->get('categoryId');
     $subtree = null;
     if (isset($categoryId)) {
         //$repo->getChildrenQueryBuilder();
         // Insert node.
         /*
                     $options = array(
                         'decorate' => true,
                         'rootOpen' => '<ul class="nav nav-list">',
                         'rootClose' => '</ul>',
                         'childOpen' => '<li>',
                         'childClose' => '</li>'
                     );
                     $node = $repo->find($categoryId);
         
                     $qb = $repo->getChildrenQueryBuilder($node, true, 'title', 'ASC', true);
                     $query = $qb->getQuery();
                     $subtree = $repo->buildTree($query->getArrayResult(), $options);
                     var_dump($subtree);*/
     }
     $options = array('decorate' => true, 'rootOpen' => '<ul class="nav nav-list">', 'rootClose' => '</ul>', 'childOpen' => '<li>', 'childClose' => '</li>', 'nodeDecorator' => function ($row) use($app, $categoryId, $subtree) {
         $url = $app['url_generator']->generate('admin_questions_get_categories', array('id' => $row['iid']));
         $title = $row['title'];
         $url = \Display::url($title, $url, array('id' => $row['iid']));
         if ($row['iid'] == $categoryId) {
             $url .= $subtree;
         }
         return $url;
     });
     // Getting all categories only first level lvl=1
     /** @var \Doctrine\ORM\QueryBuilder $qb */
     $qb = $app['orm.em']->createQueryBuilder()->select('node')->from('Entity\\CQuizCategory', 'node')->where('node.cId <> 0 AND node.lvl = 0')->orderBy('node.root, node.lft', 'ASC');
     //$node = null, $direct = false, $sortByField = null, $direction = 'ASC', $includeNode = false
     //$qb = $repo->getChildrenQueryBuilder(null, true, 'title', 'ASC', true);
     $query = $qb->getQuery();
     $tree = $repo->buildTree($query->getArrayResult(), $options);
     $app['template']->assign('category_tree', $tree);
     // Getting globals
     $query = $app['orm.em']->createQueryBuilder()->select('node')->from('Entity\\CQuizCategory', 'node')->where('node.cId = 0 AND node.lvl = 0')->orderBy('node.root, node.lft', 'ASC')->getQuery();
     $tree = $repo->buildTree($query->getArrayResult(), $options);
     $app['template']->assign('global_category_tree', $tree);
     $response = $app['template']->render_template('admin/questionmanager/question_categories.tpl');
     return new Response($response, 200, array());
 }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:59,代码来源:QuestionManagerController.php

示例2: ob_start

<?php

/* For licensing terms, see /license.txt */
/**
 * Sessions reporting
 * @package chamilo.reporting
 */
ob_start();
$cidReset = true;
//quire_once '../inc/global.inc.php';
api_block_anonymous_users();
$this_section = SECTION_TRACKING;
api_block_anonymous_users();
$htmlHeadXtra[] = api_get_jqgrid_js();
$interbreadcrumb[] = array("url" => "index.php", "name" => get_lang('MySpace'));
Display::display_header(get_lang('Sessions'));
$export_csv = false;
if (isset($_GET['export']) && $_GET['export'] == 'csv') {
    $export_csv = true;
}
/*	MAIN CODE */
if (isset($_GET['id_coach']) && $_GET['id_coach'] != '') {
    $id_coach = intval($_GET['id_coach']);
} else {
    $id_coach = api_get_user_id();
}
if (api_is_drh() || api_is_session_admin() || api_is_platform_admin()) {
    $a_sessions = SessionManager::get_sessions_followed_by_drh(api_get_user_id());
    if (!api_is_session_admin()) {
        $menu_items[] = Display::url(Display::return_icon('stats.png', get_lang('MyStats'), '', ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH) . "auth/my_progress.php");
        $menu_items[] = Display::url(Display::return_icon('user.png', get_lang('Students'), array(), ICON_SIZE_MEDIUM), "index.php?view=drh_students&amp;display=yourstudents");
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:31,代码来源:session.php

示例3: questionPoolAction

 /**
  * @param Application $app
  * @param string $cidReq
  * @param int $exerciseId
  * @return Response
  */
 public function questionPoolAction(Application $app, $cidReq = null, $exerciseId = null)
 {
     $extraJS = array();
     //@todo improve this JS includes should be added using twig
     $extraJS[] = api_get_jqgrid_js();
     $app['extraJS'] = $extraJS;
     // @todo this should be auto
     if (empty($exerciseId)) {
         $breadcrumbs = array(array('name' => get_lang('Exercise'), 'url' => array('uri' => api_get_path(WEB_CODE_PATH) . 'exercice/exercice.php?' . api_get_cidreq())), array('name' => get_lang('QuestionPool'), 'url' => array('route' => 'exercise_question_pool_global', 'routeParameters' => array('cidReq' => api_get_course_id(), 'id_session' => api_get_session_id()))));
     } else {
         $breadcrumbs = array(array('name' => get_lang('Exercise'), 'url' => array('uri' => api_get_path(WEB_CODE_PATH) . 'exercice/admin.php?' . api_get_cidreq() . '&exerciseId=' . $exerciseId)), array('name' => get_lang('QuestionPool'), 'url' => array('route' => 'exercise_question_pool', 'routeParameters' => array('cidReq' => api_get_course_id(), 'id_session' => api_get_session_id(), 'exerciseId' => $exerciseId))));
     }
     $this->setBreadcrumb($app, $breadcrumbs);
     $questionColumns = \Question::getQuestionColumns($cidReq);
     $columnModel = $questionColumns['column_model'];
     $columns = $questionColumns['columns'];
     $rules = $questionColumns['rules'];
     $grid = \Display::grid_html('questions');
     // jqgrid will use this URL to do the selects
     $extraConditions = null;
     if (!empty($cidReq)) {
         $extraConditions = "courseId=" . api_get_course_int_id();
     }
     if (!empty($exerciseId)) {
         $extraConditions .= "&exerciseId=" . $exerciseId;
     }
     $url = $app['url_generator']->generate('model_ajax') . '?a=get_questions&' . $extraConditions;
     $extraParams['postData'] = array('filters' => array("groupOp" => "AND", "rules" => $rules));
     // Auto-width.
     $extraParams['autowidth'] = 'true';
     // Height auto.
     $extraParams['height'] = 'auto';
     $token = null;
     $js = \Display::grid_js('questions', $url, $columns, $columnModel, $extraParams, array(), null, true);
     $app['template']->assign('grid', $grid);
     $app['template']->assign('js', $js);
     $response = $app['template']->render_template('exercise/question_pool.tpl');
     return new Response($response, 200, array());
 }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:45,代码来源:ExerciseController.php


注:本文中的api_get_jqgrid_js函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。