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


PHP get_block函数代码示例

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


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

示例1: get_url_block

/**
 * Получить блок по текущему URL
 *
 * @param string $name
 * @return string
 */
function get_url_block($name = null)
{
    $url = sfContext::getInstance()->getRequest()->getPathInfo();
    if ($name) {
        $url = sprintf('%s:%s', $name, $url);
    }
    return get_block($url);
}
开发者ID:pycmam,项目名称:myContentPlugin,代码行数:14,代码来源:myContentHelper.php

示例2: notify

 /**
  * notify by email the user of the reception of a message
  *
  * @param array of int: $userDataList user identificatin list
  * @param MessageToSend $message message envoy�
  * @param int $messageId identification of the message
  * 
  */
 public function notify($userDataList, $message, $messageId)
 {
     if (!get_conf('mailNotification', TRUE)) {
         return;
     }
     // sender name and email
     if ($message->getSender() == 0) {
         $userData = array('mail' => get_conf('no_reply_mail') ? get_conf('no_reply_mail') : get_conf('administrator_email'), 'firstName' => get_lang('Message from %platformName', array('%platformName' => get_conf('siteName'))), 'lastName' => '');
     } else {
         $userData = claro_get_current_user_data();
     }
     //************************************ IS MANAGER
     $stringManager = false;
     $courseManagers = claro_get_course_manager_id($message->getCourseCode());
     $nbrOfManagers = count($courseManagers);
     for ($countManager = 0; $countManager < $nbrOfManagers; $countManager++) {
         if ($message->getSender() == $courseManagers[$countManager]) {
             $courseData = claro_get_course_data($message->getCourseCode());
             $stringManager = get_block('Course manager of %course%(%courseCode%)', array('%course%' => $courseData['name'], '%courseCode%' => $courseData['officialCode']));
         }
     }
     //---------------------- email subject
     $emailSubject = '[' . get_conf('siteName');
     if (!is_null($message->getCourseCode())) {
         $courseData = claro_get_course_data($message->getCourseCode());
         if ($courseData) {
             $emailSubject .= ' - ' . $courseData['officialCode'];
         }
     }
     $emailSubject .= '] ' . $message->getSubject();
     //------------------------------subject
     /* $altBody = get_lang('If you can\'t read this message go to: ') . rtrim( get_path('rootWeb'), '/' ) . '/claroline/messaging/readmessage.php?messageId=' . $messageId . '&type=received' . "\n\n"
        . '-- '
        . claro_get_current_user_data('lastName') . " " . claro_get_current_user_data('firstName') . "\n"
        . $stringManager
        . "\n\n" . get_conf('siteName') ." <" . get_conf('rootWeb') . '>' . "\n"
        . '   ' . get_lang('Administrator') . ' : ' . get_conf('administrator_name') . ' <' . get_conf('administrator_email') . '>' . "\n"
        ; */
     //-------------------------BODY
     $msgContent = claro_parse_user_text($message->getMessage());
     $urlAppend = get_path('url');
     if (!empty($urlAppend)) {
         $msgContent = preg_replace('!href="' . get_path('url') . '!', 'href="' . rtrim(get_path('rootWeb'), '/') . '/', $msgContent);
         $msgContent = preg_replace('!\\>' . get_path('url') . '!', '>' . get_path('rootWeb'), $msgContent);
     } else {
         $msgContent = preg_replace('!href="/!', 'href="' . rtrim(get_path('rootWeb'), '/') . '/', $msgContent);
     }
     $emailBody = "<html><head></head><body>" . $msgContent . '<br /><br />' . '-- <br />' . get_lang('%firstName %lastName', array('%firstName' => $userData['firstName'], '%lastName' => $userData['lastName'])) . "<br />" . $stringManager . '<br /><br /><a href="' . get_conf('rootWeb') . '">' . get_conf('siteName') . '</a><br />' . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . get_lang('Administrator') . ': <a href="mailto:' . get_conf('administrator_email') . '">' . get_conf('administrator_name') . '</a><br />' . '</body></html>';
     //******************************** END BODY
     //******************************************
     if (empty($userData['mail']) || !is_well_formed_email_address($userData['mail'])) {
         // do not send email for a user with no mail address
         pushClaroMessage('Mail Notification Failed : User has no email or an invalid one : ' . var_export($userData, true) . '!');
         return claro_failure::set_failure(get_lang("Mail Notification Failed : You don't have any email address defined in your user profile or the defined email address is not valid."));
     }
     self::emailNotification($userDataList, $emailBody, $emailSubject, $userData['mail'], get_lang('%firstName %lastName', array('%firstName' => $userData['firstName'], '%lastName' => $userData['lastName'])));
 }
开发者ID:rhertzog,项目名称:lcs,代码行数:65,代码来源:mail.notifier.lib.php

示例3: get_all_blocks

function get_all_blocks($content, $start_pattern, $end_pattern, $include_tags = False)
{
    $result = '';
    while (($block = get_block($content, $start_pattern, $end_pattern, $include_tags)) == True) {
        $content = str_replace($block, '', $content);
        $result .= $block;
    }
    return $result;
}
开发者ID:bsebi,项目名称:xproject,代码行数:9,代码来源:create_template.php

示例4: get_menu

function get_menu($pos)
{
    global $TABLE_PREFIX, $CURUSER, $FORUMLINK, $CACHE_DURATION, $language;
    $blocks = get_result('SELECT title, content, cache FROM ' . $TABLE_PREFIX . 'blocks WHERE position="' . $pos . '" AND status=1 AND ' . $CURUSER['id_level'] . '>=minclassview  AND ' . $CURUSER['id_level'] . '<=maxclassview ' . ($FORUMLINK == '' || $FORUMLINK == 'internal' || substr($FORUMLINK, 0, 3) == 'smf' || $FORUMLINK == 'ipb' ? '' : ' AND content!="forum"') . ' ORDER BY sortid', true, $CACHE_DURATION);
    $return = '';
    foreach ($blocks as $entry) {
        $return .= get_block($language[$entry['title']], 'justify', $entry['content'], $entry['cache'] == 'yes');
    }
    return $return;
}
开发者ID:Karpec,项目名称:gizd,代码行数:10,代码来源:blocks.php

示例5: get

function get()
{
    list($name, $opt1, $opt2) = func_get_args();
    switch ($name) {
        case 'path':
            echo TEMPL_PATH;
            return;
        case 'name':
            echo NAME;
            return;
        case 'slogan':
            echo SLOGAN;
            return;
        case 'copy':
            echo COPYRIGHT;
            return;
        case 'generate':
            echo GENERATE;
            return;
        case 'title':
            echo TITLE;
            return;
        case 'menu':
            echo MENU;
            return;
        case 'content':
            echo CONTENT;
            return;
        case 'first_page':
            echo href(FIRST_PAGE);
            return;
        case 'block':
            get_block($opt1, $opt2);
            return;
    }
}
开发者ID:cheevauva,项目名称:trash,代码行数:36,代码来源:template.php

示例6: array

             $userAccountList[] = array('firstname' => $user['firstName'], 'lastname' => $user['lastName'], 'username' => $user['loginName'], 'password' => $user['password']);
         } else {
             $extAuthPasswordCount++;
         }
     }
     if ($passwordFound) {
         /*
          * Prepare the email message wich has to be send to the user
          */
         // mail subject
         $emailSubject = get_lang('Login request') . ' ' . get_conf('siteName');
         $blockLoginInfo = '';
         foreach ($userAccountList as $userAccount) {
             $blockLoginInfo .= get_block('blockLoginInfo', array('%firstname' => $userAccount['firstname'], '%lastname' => $userAccount['lastname'], '%username' => $userAccount['username'], '%password' => $userAccount['password']));
         }
         $emailBody = get_block('blockLoginRequest', array('%siteName' => get_conf('siteName'), '%rootWeb' => get_path('rootWeb'), '%loginInfo' => $blockLoginInfo));
         // send message
         if (claro_mail_user($userList[0]['uid'], $emailBody, $emailSubject)) {
             $dialogBox->success(get_lang('Your password has been emailed to') . ' : ' . $emailTo);
         } else {
             $dialogBox->error(get_lang('The system is unable to send you an e-mail.') . '<br />' . get_lang('Please contact') . ' : ' . '<a href="mailto:' . get_conf('administrator_email') . '?BODY=' . $emailTo . '">' . get_lang('Platform administrator') . '</a>');
         }
     }
 } else {
     $dialogBox->error(get_lang('There is no user account with this email address.'));
 }
 if ($extAuthPasswordCount > 0) {
     if ($extAuthPasswordCount == count($userList)) {
         $dialogBox->warning(get_lang('Your password(s) is (are) recorded in an external authentication system outside the platform.'));
     } else {
         $dialogBox->warning(get_lang('Passwords of some of your user account(s) are recorded an in external authentication system outside the platform.'));
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:lostPassword.php

示例7: die

<?php

// $Id: tiplistinit.inc.php 13708 2011-10-19 10:46:34Z abourguignon $
if (count(get_included_files()) == 1) {
    die('---');
}
/**
 * CLAROLINE
 *
 * @version     $Revision: 13708 $
 * @copyright   (c) 2001-2011, Universite catholique de Louvain (UCL)
 * @author      Claroline Team <info@claroline.net>
 * @license     http://www.gnu.org/copyleft/gpl.html
 *              GNU GENERAL PUBLIC LICENSE version 2 or later
 */
unset($tipList);
$tipList[] = array('title' => get_block('blockCourseDescriptionDescription'), 'isEditable' => false, 'question' => get_block('blockCourseDescriptionDescriptionComment1'), 'information' => get_block('blockCourseDescriptionDescriptionComment2'));
$tipList[] = array('title' => get_block('blockCourseDescriptionQualificationsAndGoals'), 'isEditable' => false, 'question' => get_block('blockCourseDescriptionQualificationsAndGoalsComment1'), 'information' => get_block('blockCourseDescriptionQualificationsAndGoalsComment2'));
$tipList[] = array('title' => get_block('blockCourseDescriptionCourseContent'), 'isEditable' => false, 'question' => get_block('blockCourseDescriptionCourseContentComment1'), 'information' => get_block('blockCourseDescriptionCourseContentComment2'));
$tipList[] = array('title' => get_block('blockCourseDescriptionTeachingTrainingActivities'), 'isEditable' => false, 'question' => get_block('blockCourseDescriptionTeachingTrainingActivitiesComment1'), 'information' => get_block('blockCourseDescriptionTeachingTrainingActivitiesComment2'));
$tipList[] = array('title' => get_block('blockCourseDescriptionSupports'), 'isEditable' => false, 'question' => get_block('blockCourseDescriptionSupportsComment1'), 'information' => get_block('blockCourseDescriptionSupportsComment2'));
$tipList[] = array('title' => get_block('blockCourseDescriptionHumanAndPhysicalRessources'), 'isEditable' => false, 'question' => get_block('blockCourseDescriptionHumanAndPhysicalResourcesComment1'), 'information' => get_block('blockCourseDescriptionHumanAndPhysicalResourcesComment2'));
$tipList[] = array('title' => get_block('blockCourseDescriptionMethodsOfEvaluation'), 'isEditable' => false, 'question' => '', 'information' => get_block('blockCourseDescriptionMethodsOfEvaluationComment1'));
开发者ID:rhertzog,项目名称:lcs,代码行数:23,代码来源:tiplistinit.inc.php

示例8: user_send_enroll_to_course_mail

/**
 * Send enroll to course succeded email to user
 * @author Mathieu Laurent <laurent@cerdecam.be>
 *
 * @param $userId integer
 * @param $data array
 * @return boolean
 */
function user_send_enroll_to_course_mail($userId, $data, $course = null)
{
    require_once dirname(__FILE__) . '/../../messaging/lib/message/messagetosend.lib.php';
    require_once dirname(__FILE__) . '/../../messaging/lib/recipient/singleuserrecipient.lib.php';
    $courseData = claro_get_course_data($course);
    $subject = get_lang('Your registration');
    $body = get_block('blockCourseSubscriptionNotification', array('%firstname' => $data['firstname'], '%lastname' => $data['lastname'], '%courseCode' => $courseData['officialCode'], '%courseName' => $courseData['name'], '%coursePath' => get_path('rootWeb') . 'claroline/course/index.php?cid=' . $courseData['sysCode'], '%siteName' => get_conf('siteName'), '%rootWeb' => get_path('rootWeb'), '%administratorName' => get_conf('administrator_name'), '%administratorPhone' => get_conf('administrator_phone'), '%administratorEmail' => get_conf('administrator_email')));
    $message = new MessageToSend(claro_get_current_user_id(), $subject, $body);
    $message->setCourse($courseData['sysCode']);
    $recipient = new SingleUserRecipient($userId);
    //$message->sendTo($recipient);
    $recipient->sendMessage($message);
    return true;
}
开发者ID:rhertzog,项目名称:lcs,代码行数:22,代码来源:course_user.lib.php

示例9: get_lang

<!-- $Id: help.tpl.php 13552 2011-09-07 12:55:36Z zefredz $ -->

<table width="100%" border="0" cellpadding="1" cellspacing="1">
<tr>
  <td align="left" valign="top">
    <h4><?php 
echo get_lang('%module% help', array('%module%' => ucfirst($this->module)));
?>
</h4>
  </td>
</tr>
<tr>
  <td>
    <?php 
echo get_block($this->block);
?>
 
  </td>
</tr>
</table>
开发者ID:rhertzog,项目名称:lcs,代码行数:20,代码来源:help.tpl.php

示例10: get_lang

<!-- $Id: help_user.tpl.php 12676 2010-10-20 14:59:33Z abourguignon $ -->

<table width="100%" border="0" cellpadding="1" cellspacing="1">
<tr>
  <td align="left" valign="top">
    <?php 
echo '<h4>' . get_lang('Users help') . '</h4>';
?>
  </td>
</tr>
<tr>
  <td>
    <?php 
echo get_block('blockUsersHelp');
?>
  </td>
</tr>
</table>
开发者ID:rhertzog,项目名称:lcs,代码行数:18,代码来源:help_user.tpl.php

示例11: claro_sql_query_get_single_row

$sql = "SELECT `comment`, `startAsset_id`, `contentType`\n        FROM `" . $TABLEMODULE . "`\n        WHERE `module_id` = " . (int) $_SESSION['module_id'];
$module = claro_sql_query_get_single_row($sql);
if (empty($module['comment']) || $module['comment'] == get_block('blockDefaultModuleComment')) {
    $noModuleComment = true;
} else {
    $noModuleComment = false;
}
if ($module['startAsset_id'] == 0) {
    $noStartAsset = true;
} else {
    $noStartAsset = false;
}
// check if there is a specific comment for this module in this path
$sql = "SELECT `specificComment`\n        FROM `" . $TABLELEARNPATHMODULE . "`\n        WHERE `module_id` = " . (int) $_SESSION['module_id'];
$learnpath_module = claro_sql_query_get_single_row($sql);
if (empty($learnpath_module['specificComment']) || $learnpath_module['specificComment'] == get_block('blockDefaultModuleAddedComment')) {
    $noModuleSpecificComment = true;
} else {
    $noModuleSpecificComment = false;
}
// check in DB if user has already browsed this module
$sql = "SELECT `contentType`,\n                `total_time`,\n                `session_time`,\n                `scoreMax`,\n                `raw`,\n                `lesson_status`\n        FROM `" . $TABLEUSERMODULEPROGRESS . "` AS UMP,\n             `" . $TABLELEARNPATHMODULE . "` AS LPM,\n             `" . $TABLEMODULE . "` AS M\n        WHERE UMP.`user_id` = '" . (int) claro_get_current_user_id() . "'\n          AND UMP.`learnPath_module_id` = LPM.`learnPath_module_id`\n          AND LPM.`learnPath_id` = " . (int) $_SESSION['path_id'] . "\n          AND LPM.`module_id` = " . (int) $_SESSION['module_id'] . "\n          AND LPM.`module_id` = M.`module_id`\n             ";
$resultBrowsed = claro_sql_query_get_single_row($sql);
// redirect user to the path browser if needed
if (!$is_allowedToEdit && (!is_array($resultBrowsed) || !$resultBrowsed || count($resultBrowsed) <= 0) && $noModuleComment && $noModuleSpecificComment && !$noStartAsset) {
    header("Location: " . Url::Contextualize("./navigation/viewer.php"));
    exit;
}
// Back button
if (!empty($_SESSION['returnToTrackingUserId'])) {
    $pathBack = Url::Contextualize(get_path('clarolineRepositoryWeb') . 'tracking/lp_modules_details.php?' . 'uInfo=' . (int) $_SESSION['returnToTrackingUserId'] . '&path_id=' . (int) $_SESSION['path_id']);
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:module.php

示例12: get_lang

<!-- $Id: help_document.tpl.php 12676 2010-10-20 14:59:33Z abourguignon $ -->

<table width="100%" border="0" cellpadding="1" cellspacing="1">
<tr>
  <td align="left" valign="top">
    <?php 
echo '<h4>' . get_lang('Documents help') . '</h4>';
?>
  </td>
</tr>
<tr>
  <td>
    <?php 
echo get_block('blockDocumentsHelp');
?>
  </td>
</tr>
</table>
开发者ID:rhertzog,项目名称:lcs,代码行数:18,代码来源:help_document.tpl.php

示例13: extraire_module_sumary

function extraire_module_sumary($baliza)
{
    if (strpos($baliza, '</block>')) {
        $baliza = str_replace("<br class='autobr' />", "", $baliza);
        $block_list = explode('</block>', $baliza);
        $return = "";
        for ($i = 0; $i < count($block_list) - 1; $i++) {
            $block = get_block($block_list[$i]);
            // $return .= '('.$i.') '.$block['class'];
            $modules = get_modules($block['content']);
            // $return .= ' - num modules:'.count($modules).' ';
            $n_audio = 0;
            $n_image = 0;
            $n_text = 0;
            $n_link = 0;
            $t = "\t\t\t\t\t\t";
            for ($u = 0; $u < count($modules); $u++) {
                // $return .= $modules[$u]['class'].' ';
                switch ($modules[$u]['class']) {
                    case "text":
                        $return .= "<p>" . $modules[$u]['content'] . "</p>\n";
                        $n_text++;
                        break;
                }
            }
        }
        return $return;
    } else {
        return $baliza;
    }
}
开发者ID:horaciogd,项目名称:CGeomap,代码行数:31,代码来源:mes_fonctions.php

示例14: get_block

 function get_block($file, $height = false)
 {
     return get_block($file);
 }
开发者ID:biladina,项目名称:pusakacms,代码行数:4,代码来源:template.php

示例15: elseif

 $out .= '<td>';
 if ($module['contentType'] == CTLABEL_) {
     $out .= "&nbsp;";
 } elseif ($module['lock'] == 'OPEN') {
     $out .= "<a href=\"" . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . "?cmd=mkBlock&cmdid=" . $module['learnPath_module_id'])) . "\">" . "<img src=\"" . get_icon_url('unblock') . "\" alt=\"" . get_lang('Block') . "\" />" . "</a>";
 } elseif ($module['lock'] == 'CLOSE') {
     $out .= "<a href=\"" . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . "?cmd=mkUnblock&cmdid=" . $module['learnPath_module_id'])) . "\">" . "<img src=\"" . get_icon_url('block') . "\" alt=\"" . get_lang('Unblock') . "\" />" . "</a>";
 }
 $out .= "</td>";
 // VISIBILITY
 $out .= "<td>";
 if ($module['visibility'] == 'HIDE') {
     $out .= "<a href=\"" . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . "?cmd=mkVisibl&cmdid=" . $module['module_id'])) . "\">" . "<img src=\"" . get_icon_url('invisible') . "\" alt=\"" . get_lang('Make visible') . "\" />" . "</a>";
 } else {
     if ($module['lock'] == 'CLOSE') {
         $onclick = "onclick=\"return confirmation('" . clean_str_for_javascript(get_block('blockConfirmBlockingModuleMadeInvisible')) . "');\"";
     } else {
         $onclick = "";
     }
     $out .= "<a href=\"" . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . "?cmd=mkInvisibl&cmdid=" . $module['module_id'])) . "\" " . $onclick . " >" . "<img src=\"" . get_icon_url('visible') . "\" alt=\"" . get_lang('Make invisible') . "\" />" . "</a>";
 }
 $out .= "</td>";
 // ORDER COMMANDS
 // DISPLAY CATEGORY MOVE COMMAND
 $out .= "<td>" . "<a href=\"" . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . "?cmd=changePos&cmdid=" . $module['learnPath_module_id'])) . "\">" . "<img src=\"" . get_icon_url('move') . "\" alt=\"" . get_lang('Move') . "\" />" . "</a>" . "</td>";
 // DISPLAY MOVE UP COMMAND only if it is not the top learning path
 if ($module['up']) {
     $out .= "<td>" . "<a href=\"" . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . "?cmd=moveUp&cmdid=" . $module['learnPath_module_id'])) . "\">" . "<img src=\"" . get_icon_url('move_up') . "\" alt=\"" . get_lang('Move up') . "\" />" . "</a>" . "</td>";
 } else {
     $out .= "<td>&nbsp;</td>";
 }
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:learningPathAdmin.php


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