本文整理汇总了PHP中hierarchy::get_actions方法的典型用法代码示例。如果您正苦于以下问题:PHP hierarchy::get_actions方法的具体用法?PHP hierarchy::get_actions怎么用?PHP hierarchy::get_actions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hierarchy
的用法示例。
在下文中一共展示了hierarchy::get_actions方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
foreach ($grade_letters as $gradelet) {
$school_name = $DB->get_record('local_school', array('id' => $gradelet->schoolid));
$line = array();
$greycss = $gradelet->visible ? ' ' : 'dimmed';
/*
* ###Bugreport #137-providing link
* @author hemalatha c arun<hemalatha@eabyas.in>
* (Resolved) providing view page links to college(organization) name
*/
$line[] = '<a href="' . $CFG->wwwroot . '/local/collegestructure/view.php?id=' . $school_name->id . '" class="' . $greycss . '">' . $school_name->fullname . '</a>';
$line[] = $gradelet->letter;
$line[] = $gradelet->markfrom;
$line[] = $gradelet->markto;
$line[] = $gradelet->gradepoint;
if (has_capability('local/gradeletter:manage', $systemcontext)) {
$buttons = $hierarchy->get_actions('gradeletter', 'edit', $gradelet->id, $gradelet->visible);
$line[] = $buttons;
}
$data[] = $line;
}
$PAGE->requires->js('/local/gradeletter/letter.js');
echo "<div id='filter-box' >";
echo '<div class="filterarea"></div></div>';
//View Part starts
//start the table
$table = new html_table();
$table->id = "gradelettertable";
$table->head = array(get_string('schoolname', 'local_collegestructure'), get_string('lettergrades', 'local_gradeletter'), get_string('markfrom', 'local_gradeletter'), get_string('markto', 'local_gradeletter'), get_string('gradepoint', 'local_gradeletter'));
示例2: array
}
$list = $resource->assignedresourcelist();
if (empty($list)) {
echo get_string('resounotassinanysch', 'local_classroomresources');
} else {
$data = array();
foreach ($list as $resour) {
$result = array();
$result[] = $DB->get_field('local_school', 'fullname', array('id' => $resour->schoolid));
$result[] = $DB->get_field('local_building', 'fullname', array('id' => $resour->buildingid));
$result[] = $DB->get_field('local_floor', 'fullname', array('id' => $resour->floorid));
$result[] = $DB->get_field('local_classroom', 'fullname', array('id' => $resour->classroomid));
$name = $resource->get_resource_name($resour->resourceid);
$result[] = $name;
if (has_capability('local/classroomresources:manage', $systemcontext))
$result[] = $hierarchy->get_actions('classroomresources', 'assignresource', $resour->id, $resour->visible);
$data[] = $result;
}
$PAGE->requires->js('/local/classroomresources/js/resourcelist.js');
echo "<div id='filter-box' >";
echo '<div class="filterarea"></div></div>';
$table = new html_table();
$table->id = "resourcelist";
$table->head = array(
get_string('schoolid', 'local_collegestructure'),
get_string('building', 'local_classroomresources'),
get_string('floor', 'local_classroomresources'),
get_string('classroom', 'local_classroomresources'),
get_string('resources', 'local_classroomresources'));
示例3: strtolower
$line[] = '<a ' . $linkcss . ' href="' . $CFG->wwwroot . '/local/programs/view.php?id=' . $program->id . '">' . format_string($program->fullname) . '</a>';
//$line[] = $program->fullname;
// Edited by hema
/* if($program->duration_format == 'Y')
$duration_format='Years';
else
if ($program->duration_format == 'M')
$duration_format='Months'; */
$line[] = $program->duration . strtolower(get_string('example', 'local_programs'));
//$line[] = $name->type;
$line[] = $name->level;
$line[] = $DB->get_field('local_school', 'fullname', array('id' => $program->schoolid));
//---------checking capabilities----------------------------
$capabilities_array =$myprogram->program_capabilities(array('create','view'));
if (has_any_capability($capabilities_array, $systemcontext)) {
$line[] = $hierarchy->get_actions('programs', 'program', $program->id, $program->visible);
}
$data[] = $line;
}
}
//Tab view
$myprogram->createtabview($currenttab);
//echo $OUTPUT->heading(get_string('programlist', 'local_programs'));
//Description for the page
if (isset($CFG->allowframembedding) and ! $CFG->allowframembedding) {
echo $OUTPUT->box(get_string('viewprogramspage', 'local_programs'));
}
$PAGE->requires->js('/local/programs/js/program.js');
示例4: require
!empty($eactivity->semesterid) ? $eventinfo .='<span><strong>' . get_string('semester', 'local_semesters') . ' :</strong> ' . $semestername . '</span><br />' : null;
$eventinfo .= '<span><strong>' . get_string('eventlevel', 'local_academiccalendar') . ':</strong> ' . $eventls[$eactivity->eventlevel] . '</span><br />';
$line[] = $eventinfo;
$date = $startdate;
!empty($enddate) ? $date .= ' - ' . $enddate : null;
$line[] = $date;
$line[] = $startdate;
$line[] = $enddate;
!empty($eactivity->schoolid) ? $line[] = $schoolname : $line[] = null;
!empty($eactivity->programid) ? $line[] = $programname : $line[] = null;
!empty($eactivity->semesterid) ? $line[] = $semestername : $line[] = null;
$line[] = !empty($eactivity->eventlevel) ? $acalendar->eventls[$eactivity->eventlevel] : null;
if (is_siteadmin($USER) || has_any_capability($capabilities_array, $systemcontext)) {
$buttons = $hierarchy->get_actions('academiccalendar', 'edit_event', $eactivity->id, $eactivity->publish);
$line[] = $buttons;
}
$data[] = $line;
}
if (is_siteadmin($USER) || has_capability('local/collegestructure:manage', $systemcontext)) {
$currenttab = 'view';
require('tabs.php');
}
/* ---Moodle 2.2 and onwards--- */
if (!$acalendar->is_student()) {
if (isset($CFG->allowframembedding) and ! $CFG->allowframembedding) {
echo $OUTPUT->box(get_string('vieweventdescription', 'local_academiccalendar'));
}
}
示例5: array
$clases = $resource->cobalt_classroom();
if (empty($clases)) {
echo get_string('noclsroom', 'local_classroomresources');
} else {
$data = array();
foreach ($clases as $class) {
$result = array();
$linkcss = $class->visible ? ' ' : 'class="dimmed" ';
$result[] = '<a ' . $linkcss . ' href="' . $CFG->wwwroot . '/local/classroomresources/classroomdetails.php?id=' . $class->id . '">' . format_string($class->fullname) . '</a>';
$result[] = $class->shortname;
$result[] = $class->floorname;
$result[] = $class->buildingname;
$result[] = $class->schoolname;
if (has_capability('local/classroomresources:manage', $systemcontext))
$result[] = $hierarchy->get_actions('classroomresources', 'classroom', $class->id, $class->visible);
$data[] = $result;
}
$PAGE->requires->js('/local/classroomresources/js/class.js');
echo "<div id='filter-box' >";
echo '<div class="filterarea"></div></div>';
$table = new html_table();
$table->id = "class";
$table->head = array(
get_string('classroom', 'local_classroomresources'),
get_string('shortname', 'local_classroomresources'),
get_string('floor', 'local_classroomresources'),
get_string('building', 'local_classroomresources'),
get_string('schoolname', 'local_collegestructure'));
if (has_capability('local/classroomresources:manage', $systemcontext))
示例6: array
*/
$sem = $DB->get_record('local_semester', array('id' => $semester->semesterid));
$line = array();
$name = $mysemester->names($sem);
$linkcss = $sem->visible ? ' ' : 'class="dimmed" ';
$line[] = '<a ' . $linkcss . ' href="' . $CFG->wwwroot . '/local/semesters/view.php?id=' . $sem->id . '">' . format_string($sem->fullname) . '</a>';
$line[] = $DB->get_field('local_school', 'fullname', array('id' => $semester->schoolid));
$line[] = $name->startdate;
$line[] = $name->enddate;
// $line[] = $semester->mincredit;
// $line[] = $semester->maxcredit;
//get action buttons for crud operations
//---------checking capabilities----------------------------
if (has_any_capability($capabilities_array, $systemcontext)) {
$line[] = $hierarchy->get_actions('semesters', 'semester', $semester->semesterid, $sem->visible, $mode, $semester->schoolid);
}
$data[] = $line;
}
//Tab view
$mysemester->createtabview($mode);
//Description for the page
if ($mode == 'current') {
if (isset($CFG->allowframembedding) and ! $CFG->allowframembedding) {
echo $OUTPUT->box(get_string('viewcursemesterspage', 'local_semesters'));
}
} elseif ($mode == 'upcoming') {
echo $OUTPUT->box(get_string('viewupsemesterspage', 'local_semesters'));
} else {
示例7: collegegrid
/**
* @method collegegrid
* @todo To display -Grid view of college structure will all the schools,programs and departments
* @param int $page page number
* @param int $perpage
*/
public function collegegrid($page, $flist, $perpage) {
global $DB, $CFG, $USER, $OUTPUT;
/* ---Get the records from the database--- */
$hierarchy = new hierarchy();
$i = 1;
$sql = "SELECT * FROM {local_school} ORDER BY sortorder";
$schoolgrid = $DB->get_records_sql($sql);
$totalcount = count($schoolgrid);
foreach ($schoolgrid as $school) {
$j = 1;
$k = 1;
$sql = " SELECT distinct(s.id),s.* FROM {local_school} s where
(s.id={$school->id} AND id in(select schoolid from {local_school_permissions}
where schoolid={$school->id} AND userid={$USER->id}))
ORDER BY s.sortorder ";
$checkpermissions = $DB->get_records_sql($sql);
$creatprogram = '<a title="Add Program" href="' . $CFG->wwwroot . '/local/programs/program.php?id=-1&scid=' . $school->id . '&sesskey=' . sesskey() . '">Add Program</a>';
$creatdepartment = '<a title="Add Course Library" href="' . $CFG->wwwroot . '/local/departments/departments.php?id=-1&scid=' . $school->id . '&sesskey=' . sesskey() . '">Add Course Library</a>';
/* ---start of the first division--- */
$linkcss = $school->visible ? ' ' : 'class="dimmed" ';
$showdepth = 1;
if ($checkpermissions || is_siteadmin()){
$str = '<div style="border:0px solid red" id="hierarchy-index">';
/* ---printing the school and it actions--- */
$str .='<div >
<div style="padding:5px 0px 5px 3px;font-size:14px;border:0px solid #000;background:#CAE1FC">
<a ' . $linkcss . ' href="' . $CFG->wwwroot . '/local/collegestructure/view.php?id=' . $school->id . '">' . $this->display_hierarchy_item($school, $showdepth) . '</a>';
$str .='<span style="width:47%;float:right">';
if ($checkpermissions || is_siteadmin())
$str .= $hierarchy->get_actions('collegestructure', 'school', $school->id, $school->visible);
$str .='</span></div> ';
/* ---printing the manage program label--- */
$str .='<div style="border-width:0px 0px 0px 0px;border-style:solid;border-color:#DDD">
<div style="border-width:0px 0px 1px 0px;border-style:solid;border-color:#DDD;height:29px;padding:4px 3px 4px 36px;font-weight:bold;font-size:16px;">Programs
<span style="width:50%;float:right"> ';
if ($checkpermissions || is_siteadmin())
$str .= $creatprogram;
$str .='</span> </div>';
/* ---get the program records which are assigned to particular school--- */
$programlists = $DB->get_records('local_program', array('schoolid' => $school->id));
/* ---if programs are listed them show them all--- */
if ($programlists) {
$programname = array();
foreach ($programlists as $programlist) {
/* ---print the programs and it actions--- */
$linkcss = $programlist->visible ? ' ' : 'class="dimmed" ';
$str .='<div style="border-width:0px 0px 0px 0px;border-style:solid;border-color:#DDD">
<div style="padding:8px 0px 8px 50px;border:0px solid #888000">' . $j . '. <a ' . $linkcss . ' href="' . $CFG->wwwroot . '/local/programs/view.php?id=' . $programlist->id . '&scid=' . $school->id . '">' . $programlist->fullname . '</a>';
$str .='<span style="width:50%;float:right;border:0px solid #000">';
if ($checkpermissions || is_siteadmin())
$str .=$hierarchy->get_actions('programs', 'program', $programlist->id, $programlist->visible, 'NULL', $school->id);
$str .='</span> </div> </div> ';
$j++;
}
}
$str .='</div>';
/* ---end of the program list--- */
/* ---start of the department management--- */
/* ---course/category.php?id=15&categoryedit=on&sesskey=B1DqJnEYxM--- */
$str .='<div style="border-width:0px 0px 0px 0px;border-style:solid;border-color:#DDD">
<div style="border-width:0px 0px 0px 0px;border-style:solid;border-color:#DDD;height:33px;padding:3px 3px 3px 36px;font-weight:bold;font-size:16px;">Course Library
<span style="width:50%;float:right"> ';
if ($checkpermissions || is_siteadmin())
$str .= $creatdepartment;
$str .='</span>
</div>';
/* ---get the list of all the department assigned to the school--- */
$departmentlists = $DB->get_records('local_department', array('schoolid' => $school->id));
/* ---if departments are listed show them all--- */
if ($departmentlists) {
$departmentname = array();
foreach ($departmentlists as $departmentlist) {
/* ---print the department and it actions--- */
$linkcss = $departmentlist->visible ? ' ' : ' class="dimmed" ';
$str .='<div style="border-width:0px 0px 0px 0px;border-style:solid;border-color:#DDD">
<div style="padding:8px 0px 8px 50px;">' . $k . '. <a ' . $linkcss . ' href="' . $CFG->wwwroot . '/local/departments/viewdept.php?id=' . $departmentlist->id . '&scid=' . $school->id . '&sesskey=B1DqJnEYxM">' . $departmentlist->fullname . '</a>';
$str .='<span style="width:50%;float:right">';
if ($checkpermissions || is_siteadmin())
$str .=$hierarchy->get_actions('departments', 'departments', $departmentlist->id, $departmentlist->visible, 'NULL', $school->id);
$str .='</span></div> </div> ';
$k++;
}
}
$str .='</div>';
/* ---niranjan take care of this div--- */
$str .='</div>';
$str .='</div>';
$i++;
echo $str;
//.........这里部分代码省略.........
示例8: IN
$sql = "SELECT * FROM {local_cobaltcourses} WHERE schoolid IN ($schoolid)";
$courses = $DB->get_records_sql($sql);
foreach ($courses as $course) {
$line = array();
$linkcss = $course->visible ? ' ' : 'class="dimmed" ';
$line[] = '<a ' . $linkcss . ' href="' . $CFG->wwwroot . '/local/cobaltcourses/view.php?id=' . $course->id . '&title=' . $title . '&plugin=cobaltcourses&page=index">' . format_string($course->shortname) . '</a>';
$line[] = $course->fullname;
$line[] = ($course->coursetype == 0) ? get_string('general', 'local_cobaltcourses') : get_string('elective', 'local_cobaltcourses');
$line[] = $DB->get_field('local_department', 'fullname', array('id' => $course->departmentid));
$line[] = $DB->get_field('local_school', 'fullname', array('id' => $course->schoolid));
$line[] = $course->credithours;
//-------------------Edited by hema------------------------------------------
if (has_any_capability($capabilities_array, $systemcontext)) {
$line[] = $hierarchy->get_actions('cobaltcourses', 'cobaltcourse', $course->id, $course->visible);
}
$data[] = $line;
}
/* ---Current tab--- */
$currenttab = 'view';
/* ---adding tabs--- */
createtabview($currenttab);
/* ---Heading of the page--- */
if (isset($CFG->allowframembedding) and ! $CFG->allowframembedding) {
echo $OUTPUT->box(get_string('descriptionforviewpage', 'local_cobaltcourses'));
}
示例9: array
$floors = $resource->cobalt_floor();
if (empty($floors)) {
echo get_string('noflor', 'local_classroomresources');
} else {
$data = array();
foreach ($floors as $floor) {
$result = array();
$linkcss = $floor->visible ? ' ' : 'class="dimmed" ';
$result[] = '<a ' . $linkcss . ' href="' . $CFG->wwwroot . '/local/classroomresources/floordetails.php?id=' . $floor->id . '">' . format_string($floor->fullname) . '</a>';
$result[] = $floor->shortname;
$result[] = $floor->buildingname;
$result[] = $floor->schoolname;
if (has_capability('local/classroomresources:manage', $systemcontext))
$result[] = $hierarchy->get_actions('classroomresources', 'floor', $floor->id, $floor->visible);
$data[] = $result;
}
$PAGE->requires->js('/local/classroomresources/js/floor.js');
echo "<div id='filter-box' >";
echo '<div class="filterarea"></div></div>';
$table = new html_table();
$table->id = "floor";
$table->head = array(
get_string('floor', 'local_classroomresources'),
get_string('shortname', 'local_classroomresources'),
get_string('building', 'local_classroomresources'),
get_string('schoolid', 'local_collegestructure'));
if (has_capability('local/classroomresources:manage', $systemcontext))
示例10: date
$line[] = $exam->lecturetype;
$line[] = $exam->classname;
$line[] = $cobcourse->fullname;
$exam->starttimehour = ($exam->starttimehour < 10) ? '0' . $exam->starttimehour : $exam->starttimehour;
$exam->starttimemin = ($exam->starttimemin < 10) ? '0' . $exam->starttimemin : $exam->starttimemin;
$exam->endtimehour = ($exam->endtimehour < 10) ? '0' . $exam->endtimehour : $exam->endtimehour;
$exam->endtimemin = ($exam->endtimemin < 10) ? '0' . $exam->endtimemin : $exam->endtimemin;
$line[] = date("M d Y", $exam->opendate) . ',<br/>' . $exam->starttimehour . ':' . $exam->starttimemin . ' to ' . $exam->endtimehour . ':' . $exam->endtimemin;
// $line[] = $exam->schoolname;
if (has_any_capability($capabilities_array, $systemcontext)) {
$hierarchy = new hierarchy();
$line[] = $exam->semestername;
$buttons = $hierarchy->get_actions('scheduleexam', 'edit', $exam->id, $exam->visible);
$line[] = $buttons;
$data[] = $line;
} else {
$data[] = $line;
}
}
} else {
$row = new html_table_row();
$optioncell = new html_table_cell(get_string('no_records', 'local_request'));
$optioncell->colspan = 7;
$row ->cells[] = $optioncell;
$data[]=$row;
}