本文整理汇总了PHP中get_path函数的典型用法代码示例。如果您正苦于以下问题:PHP get_path函数的具体用法?PHP get_path怎么用?PHP get_path使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_path函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getResourcesList
/**
* Returns all the descriptions of a course.
* @throws InvalidArgumentException if the $cid in not provided.
* @webservice{/module/MOBILE/GEN/getResourcesList/cidReq}
* @ws_arg{method,getResourcesList}
* @ws_arg{cidReq,SYSCODE of requested cours}
* @return array of Descriptions object
*/
function getResourcesList($args)
{
$module = isset($args['module']) ? $args['module'] : null;
$cid = claro_get_current_course_id();
if ($cid == null || $module == null) {
throw new InvalidArgumentException('Missing cid argument!');
}
$list = array();
FromKernel::uses('core/linker.lib');
ResourceLinker::init();
$locator = new ClarolineResourceLocator($cid, $module, null, claro_get_current_group_id());
if (ResourceLinker::$Navigator->isNavigable($locator)) {
$resourceList = ResourceLinker::$Navigator->getResourceList($locator);
foreach ($resourceList as $lnk) {
$inLocator = $lnk->getLocator();
$item['title'] = $lnk->getName();
$item['visibility'] = $lnk->isVisible();
$item['url'] = str_replace(get_path('url'), "", get_path('rootWeb')) . ResourceLinker::$Resolver->resolve($inLocator);
if ($inLocator->hasResourceId()) {
$item['resourceId'] = $inLocator->getResourceId();
} else {
$item['resourceId'] = $item['url'];
}
if (claro_is_allowed_to_edit() || $item['visibility']) {
$list[] = $item;
}
}
}
return $list;
}
示例2: renderContent
public function renderContent()
{
global $platformLanguage;
$out = '';
// Last user action
$lastUserAction = isset($_SESSION['last_action']) && $_SESSION['last_action'] != '1970-01-01 00:00:00' ? $_SESSION['last_action'] : date('Y-m-d H:i:s');
$userCommands = array();
// User commands
// 'Create Course Site' command. Only available for teacher.
if (claro_is_allowed_to_create_course()) {
$userCommands[] = '<a href="' . claro_htmlspecialchars(Url::Contextualize(get_path('clarolineRepositoryWeb') . 'course/create.php')) . '" class="userCommandsItem">' . '<img src="' . get_icon_url('courseadd') . '" alt="" /> ' . get_lang('Create a course site') . '</a>' . "\n";
} elseif ($GLOBALS['currentUser']->isCourseCreator) {
$userCommands[] = '<span class="userCommandsItemDisabled">' . '<img src="' . get_icon_url('courseadd') . '" alt="" /> ' . get_lang('Create a course site') . '</span>' . "\n";
}
if (get_conf('allowToSelfEnroll', true)) {
$userCommands[] = '<a href="' . claro_htmlspecialchars(Url::Contextualize(get_path('clarolineRepositoryWeb') . 'auth/courses.php?cmd=rqReg&categoryId=0')) . '" class="userCommandsItem">' . '<img src="' . get_icon_url('enroll') . '" alt="" /> ' . get_lang('Enrol on a new course') . '</a>' . "\n";
$userCommands[] = '<a href="' . claro_htmlspecialchars(Url::Contextualize(get_path('clarolineRepositoryWeb') . 'auth/courses.php?cmd=rqUnreg')) . '" class="userCommandsItem">' . '<img src="' . get_icon_url('unenroll') . '" alt="" /> ' . get_lang('Remove course enrolment') . '</a>' . "\n";
}
$userCommands[] = '<a href="' . claro_htmlspecialchars(Url::Contextualize(get_path('clarolineRepositoryWeb') . 'course/platform_courses.php')) . '" class="userCommandsItem">' . '<img src="' . get_icon_url('course') . '" alt="" /> ' . get_lang('All platform courses') . '</a>' . "\n";
$userCommands[] = '<a href="' . claro_htmlspecialchars(Url::Contextualize(get_path('clarolineRepositoryWeb') . 'notification_date.php')) . '" class="userCommandsItem">' . '<img class="iconDefinitionList" src="' . get_icon_url('hot') . '" alt="' . get_lang('New items') . '" />' . ' ' . get_lang('New items') . ' ' . get_lang('to another date') . (substr($lastUserAction, strlen($lastUserAction) - 8) == '00:00:00' ? ' [' . claro_html_localised_date(get_locale('dateFormatNumeric'), strtotime($lastUserAction)) . ']' : '') . '</a>' . "\n";
$userCourseList = render_user_course_list();
$userCourseListDesactivated = render_user_course_list_desactivated();
$out .= '<div class="userCommands">' . '<h2>' . get_lang('Manage my courses') . '</h2>' . claro_html_list($userCommands) . '</div>' . '<div class="userCourseList">' . '<h2>' . get_lang('My course list') . '</h2>' . $userCourseList;
if (!empty($userCourseListDesactivated)) {
$out .= '<h4>' . get_lang('Deactivated course list') . '</h4>' . $userCourseListDesactivated;
}
$out .= '</div>';
/*'</td>'
. '</tr>'
. '</tbody>'
. '</table>'*/
$this->content = $out;
return $this->content;
}
示例3: class_loader
/**
* A helper function to load the Nmwdhj classes.
*
* @return void
* @since 1.2
*/
function class_loader($class_name)
{
$nps = explode('\\', $class_name, 3);
if ('Nmwdhj' !== $nps[0] || count($nps) === 1) {
return;
}
switch ($nps[1]) {
case 'Manager':
case 'Exception':
case 'EventManager':
case 'PriorityArray':
$class_path = get_path('core/Essentials.php');
break;
case 'Attributes':
$class_path = get_path('core/Attributes.php');
break;
case 'Elements':
if (!empty($nps[2])) {
$class_path = get_path(sprintf('elements/%s.php', $nps[2]));
}
break;
case 'Views':
if (!empty($nps[2])) {
$class_path = get_path(sprintf('elements/views/%s.php', $nps[2]));
}
break;
}
if (!empty($class_path) && file_exists($class_path)) {
require $class_path;
}
}
示例4: addAdminScripts
function addAdminScripts($hook_suffix)
{
wp_register_script('', get_path('js') . '', array('jquery'), '', true);
if ($hook_suffix == '') {
wp_enqueue_script(array());
}
}
示例5: resolve
public function resolve(ResourceLocator $locator)
{
if ($locator->hasResourceId()) {
$context = Claro_Context::getCurrentContext();
$context[CLARO_CONTEXT_COURSE] = $locator->getCourseId();
if ($locator->inGroup()) {
$context[CLARO_CONTEXT_GROUP] = $locator->getGroupId();
}
$path = get_path('coursesRepositorySys') . claro_get_course_path($locator->getCourseId());
// in a group
if ($locator->inGroup()) {
$groupData = claro_get_group_data($context);
$path .= '/group/' . $groupData['directory'];
$groupId = $locator->getGroupId();
} else {
$path .= '/document';
}
$path .= '/' . ltrim($locator->getResourceId(), '/');
$resourcePath = '/' . ltrim($locator->getResourceId(), '/');
$path = secure_file_path($path);
if (!file_exists($path)) {
throw new Exception("Resource not found {$path}");
} elseif (is_dir($path)) {
$url = new Url(get_module_entry_url('CLDOC'));
$url->addParam('cmd', 'exChDir');
$url->addParam('file', base64_encode($resourcePath));
return $url->toUrl();
} else {
return get_module_url('CLDOC') . '/connector/cllp.frames.cnr.php';
return claro_get_file_download_url($resourcePath, Claro_Context::getUrlContext($context));
}
} else {
return get_module_entry_url('CLDOC');
}
}
示例6: load_path
function load_path($dir, $path)
{
$file = get_path($dir, $path);
if (file_exists($file)) {
require_once $file;
}
}
示例7: CLANN_write_ical
/**
* CLAROLINE
*
* @version $Revision: 13708 $
* @copyright (c) 2001-2011, Universite catholique de Louvain (UCL)
* @license http://www.gnu.org/copyleft/gpl.html (GPL) GENERAL PUBLIC LICENSE
* @package CLANN
* @subpackage CLICAL
* @author Claro Team <cvs@claroline.net>
*/
function CLANN_write_ical($iCal, $context)
{
if (is_array($context) && count($context) > 0) {
$courseId = array_key_exists(CLARO_CONTEXT_COURSE, $context) ? $context[CLARO_CONTEXT_COURSE] : claro_get_current_course_id();
}
require_once dirname(__FILE__) . '/../lib/announcement.lib.php';
$courseData = claro_get_course_data($courseId);
$toolNameList = claro_get_tool_name_list();
$announcementList = announcement_get_item_list($context, 'DESC');
$organizer = (array) array($courseData['titular'], $courseData['email']);
$attendees = array();
$categories = array(get_conf('siteName'), $courseData['officialCode'], trim($toolNameList['CLANN']));
foreach ($announcementList as $announcementItem) {
if ('SHOW' == $announcementItem['visibility']) {
/*
$rssList[] = array( 'title' => trim($announcementItem['title'])
, 'category' => trim($toolNameList['CLANN'])
, 'guid' => get_module_url('CLANN') . '/announcements.php?cidReq='.claro_get_current_course_id().'&l#ann'.$announcementItem['id']
, 'link' => get_module_url('CLANN') . '/announcements.php?cidReq='.claro_get_current_course_id().'&l#ann'.$announcementItem['id']
, 'description' => trim(str_replace('<!-- content: html -->','',$announcementItem['content']))
, 'pubDate' => date('r', stripslashes(strtotime($announcementItem['time'])))
//, 'author' => $_course['email']
);
*/
$iCal->addJournal(trim($announcementItem['title']), trim(str_replace('<!-- content: html -->', '', $announcementItem['content'])), strtotime($announcementItem['time']), strtotime($announcementItem['time']), time(), 1, 1, $organizer, $attendees, $categories, 5, 10, 1, array(), 0, '', get_path('rootWeb') . get_module_url('CLANN') . '/announcements.php?cidReq=' . $courseId . '&l#ann' . $announcementItem['id'], get_locale('iso639_1_code'), '');
}
}
return $iCal;
}
示例8: callback_parse_path
function callback_parse_path($matches)
{
if (count($matches) < 2) {
return "";
}
return get_path($matches[1]);
}
示例9: update
public function update($id, $args)
{
$langs = get_langs();
if ($this->valid($args, $this->rules())) {
$page = $this->findItem($id);
$page->image = get_path($args['image']);
$page->post_status = $args['post_status'];
$page->template = $args['template'];
if (!$page->update()) {
throw new ExcuteException('save_error', 'Không lưu được');
}
$syncs = [];
foreach ($langs as $lang) {
$code = $args[$lang->code];
$page_title = $code['post_title'];
$slug = $code['slug'];
$slug = trim($slug) == '' ? toSlug($page_title) : toSlug($slug);
$page_desc = ['post_title' => $page_title, 'slug' => $slug, 'post_content' => $code['post_content'], 'post_excerpt' => $code['post_excerpt']];
$syncs[$lang->id] = $page_desc;
}
$page->langs()->sync($syncs);
} else {
throw new ValidationException('Error Validation', 'Điền đầy đủ các thông tin!');
}
}
示例10: GENERAR_ARTICULOS
function GENERAR_ARTICULOS()
{
$data = '';
$categoria = isset($_GET['categoria']) ? db_codex($_GET['categoria']) : 0;
if ($categoria) {
$c = "SELECT * FROM ventas_categorias WHERE id_categoria='{$categoria}'";
$resultado = db_consultar($c);
if (db_resultado($resultado, 'padre') > 0) {
$data .= "<h1>Mostrando publicaciones de la sub-categoria <span style='color:#00F'>" . db_resultado($resultado, 'nombre') . "</span></h1>";
$data .= "Ubicación: " . get_path($categoria) . "<br />";
$data .= "<hr />";
$data .= "Deseo publicar una <a href=\"./vender?op={$categoria}\">venta</a> en esta categoría<br />";
$data .= "<hr />";
$WHERE = "z.id_categoria='{$categoria}'";
} else {
$data .= "<h1>Mostrando publicaciones recientes de la categoria <span style='color:#00F'>" . db_resultado($resultado, 'nombre') . "</span></h1>";
$WHERE = "(SELECT padre FROM ventas_categorias AS b where b.id_categoria=z.id_categoria)='{$categoria}'";
}
} else {
$data .= "<h1>Publicaciones mas recientes</h1>";
// Mostrar todos los articulos recientes
$WHERE = "1";
}
$WHERE .= " AND z.tipo IN (" . _A_aceptado . "," . _A_promocionado . ") AND fecha_fin >= CURDATE()";
$data .= VISTA_ListaPubs($WHERE, "ORDER BY promocionado DESC, fecha_ini DESC", "indice");
return $data;
}
示例11: get_block
/**
* return the content
*
* @param coursecode $key
* @param array $context
* @return string : html content
*/
public static function get_block($key, $isadmin, $context = null, $right = null)
{
$out = self::get_content($key, $context, $right);
if ($isadmin) {
$out .= '<p>' . "\n" . '<a href="' . get_path('rootAdminWeb') . 'managing/editFile.php?cmd=rqEdit&file=textzone_messaging_top.inc.html">' . "\n" . '<img src="' . get_icon_url('edit') . '" alt="" />' . get_lang('Edit text zone') . "\n" . '</a>' . "\n" . '</p>';
}
return $out;
}
示例12: after_setup_theme
/**
* Sets up theme defaults and registers support for various features.
*/
function after_setup_theme()
{
load_theme_textdomain(config('textdomain'), get_path('i18n'));
// Let WordPress manage the document title.
// By adding theme support, we declare that this theme does not use a
// hard-coded <title> tag in the document head, and expect WordPress to
// provide it for us.
add_theme_support('title-tag');
}
示例13: down
public function down()
{
$this->remove_access();
$this->remove_menu();
$this->remove_setting();
@unlink(get_path('{www}{www image}/people'));
$this->drop_table('cms_people');
return true;
}
示例14: claro_is_user_platform_admin
/**
* return true if the user in parameter is admin, false is the user in parameter is not admin
*
* @param int $userId
* @return bool true if the user is admin
* false if the user is not admin
*/
function claro_is_user_platform_admin($userId)
{
static $uidAdmin = false;
require_once get_path('incRepositorySys') . '/lib/user.lib.php';
if (!$uidAdmin) {
$uidAdmin = claro_get_uid_of_platform_admin();
}
return in_array($userId, $uidAdmin);
}
示例15: down
public function down()
{
$this->remove_access();
$this->remove_menu();
$this->drop_table('cms_banners');
/* remove only if empty */
@unlink(get_path('{www}{www image}/banners'));
return true;
}