本文整理汇总了PHP中Routes::getPage方法的典型用法代码示例。如果您正苦于以下问题:PHP Routes::getPage方法的具体用法?PHP Routes::getPage怎么用?PHP Routes::getPage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Routes
的用法示例。
在下文中一共展示了Routes::getPage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: htmlspecialchars
echo htmlspecialchars($group['mail']);
?>
<br />
<?php
}
?>
</div>
</div>
<?php
}
?>
</div>
<?php
if ($is_admin) {
?>
<p>
<a href="<?php
echo Config::URL_ROOT . Routes::getPage('group_add');
?>
"><img src="<?php
echo Config::URL_STATIC;
?>
images/icons/add.png" alt="" class="icon" /> <?php
echo __('GROUP_ADD');
?>
</a>
</p>
<?php
}
示例2: __
echo __('GROUP_EDIT_FORM_MEMBER_ADMIN');
?>
</label>
</li>
<?php
}
?>
</ul>
<label for="group_edit_add_member"><?php
echo __('GROUP_EDIT_FORM_ADD_MEMBER');
?>
</label>
<input type="text" name="" id="group_edit_add_member" value="" />
<input type="hidden" name="" id="group_edit_add_member_url" value="<?php
echo Config::URL_ROOT . Routes::getPage('autocompletion_student_name');
?>
" />
</div>
<br />
<input type="submit" value="<?php
echo __('GROUP_EDIT_FORM_SUBMIT');
?>
" />
</div>
</form>
</div>
示例3: array
echo Config::URL_ROOT . Routes::getPage('admin', array("nav" => "admins"));
?>
" method="post" id="form_admins">
<input type="hidden" name="type" value="students" id="type" />
<label for="admin_edit_add_admin"><?php
echo __('GROUP_EDIT_FORM_ADD_MEMBER');
?>
</label>
<input type="text" size="25" style="margin: 5px;" name="admin_edit_add_admin" id="admin_edit_add_admin" value="" class="autocomplete" autocomplete="off"/>
<span id="error-com" class="error hidden" ><?php
echo __('ISEPOR_ERROR_AUTOCOMPLETE');
?>
</span>
<span id="error-nan" class="error hidden" ><?php
echo __('ISEPOR_ERROR_NOT_EXIST');
?>
</span>
<input type="hidden" name="url" id="admin_edit_add_admin_url" value="<?php
echo Config::URL_ROOT . Routes::getPage('autocomplete_isepor');
?>
" />
<input class="valid" type="hidden" name="valid-students" id="valid" value="" />
<br/><input type="submit" value="<?php
echo __('ADMIN_ENVOYER');
?>
"/>
</form>
<br/><br/>
示例4: array
</div>
<?php
}
?>
</div>
<div id="showlistpodcast" class="hidden">
<?php
for ($i = 0; $i < count($annee4); $i++) {
$bloc = "";
$bloc2 = "";
$bloc3 = "";
for ($a = 0; $a <= count($mediaannee4['' . $annee4[$i] . '']); $a++) {
if (isset($mediaannee4['' . $annee4[$i] . ''][$a])) {
$id = $mediaannee4['' . $annee4[$i] . ''][$a];
if (isset($mediamessage4[$id]) && isset($categorie[$id])) {
$route = Config::URL_ROOT . Routes::getPage('post', array('id' => $id));
$title = str_split($mediamessage4[$id], 35);
$category = $categorie[$id];
if (isset($title[1]) && $title[1] != "") {
$etc = "...";
} else {
$etc = "";
}
$spanline = round(count($mediaannee4['' . $annee4[$i] . '']) / 3);
$icon = "<img src='" . Config::URL_STATIC . "images/icons/attachment_podcast.png' alt='' class='icon' /> ";
if ($id != 0) {
if ($a <= $spanline) {
$bloc .= $icon . "<a href='" . $route . "' title=\"" . $mediamessage4[$id] . "\">" . $title[0] . $etc . "</a><br/>";
} elseif ($a <= 2 * $spanline) {
$bloc2 .= $icon . "<a href='" . $route . "' title=\"" . $mediamessage4[$id] . "\">" . $title[0] . $etc . "</a><br/>";
} else {
示例5: iframe_add
//.........这里部分代码省略.........
throw new Exception(__('POST_ADD_ERROR_FILE_SIZE', array('size' => File::humanReadableSize(Config::UPLOAD_MAX_SIZE_FILE))));
}
}
if ($filepaths = File::upload('attachment_file')) {
foreach ($filepaths as $filepath) {
$uploaded_files[] = $filepath;
}
foreach ($filepaths as $i => $filepath) {
if (!preg_match('#\\.[a-z0-9]{2,4}$#i', $filepath)) {
throw new Exception(__('POST_ADD_ERROR_FILE_FORMAT'));
}
if (preg_match('#\\.(jpg|png|gif|mp3|flv)$#i', $filepath)) {
throw new Exception(__('POST_ADD_ERROR_FILE_FORMAT2'));
}
$name = isset($_FILES['attachment_file']['name'][$i]) ? $_FILES['attachment_file']['name'][$i] : '';
$attachments[] = array($filepath, $name);
}
}
}
// Event
if (isset($_POST['event_title']) && isset($_POST['event_start']) && isset($_POST['event_end'])) {
// Title
$event_title = trim($_POST['event_title']);
if ($event_title == '') {
throw new Exception(__('POST_ADD_ERROR_EVENT_NO_TITLE'));
}
// Dates
if (!($event_start = strptime($_POST['event_start'], __('PUBLISH_EVENT_DATE_FORMAT')))) {
throw new Exception(__('POST_ADD_ERROR_EVENT_DATE'));
}
if (!($event_end = strptime($_POST['event_end'], __('PUBLISH_EVENT_DATE_FORMAT')))) {
throw new Exception(__('POST_ADD_ERROR_EVENT_DATE'));
}
$event_start = mktime($event_start['tm_hour'], $event_start['tm_min'], 0, $event_start['tm_mon'] + 1, $event_start['tm_mday'], $event_start['tm_year'] + 1900);
$event_end = mktime($event_end['tm_hour'], $event_end['tm_min'], 0, $event_end['tm_mon'] + 1, $event_end['tm_mday'], $event_end['tm_year'] + 1900);
if ($event_start > $event_end) {
throw new Exception(__('POST_ADD_ERROR_EVENT_DATE_ORDER'));
}
$event = array($event_title, $event_start, $event_end);
} else {
$event = null;
}
// Survey
if (isset($_POST['survey_question']) && isset($_POST['survey_end']) && isset($_POST['survey_answer']) && is_array($_POST['survey_answer'])) {
// Question
$survey_question = trim($_POST['survey_question']);
if ($survey_question == '') {
throw new Exception(__('POST_ADD_ERROR_SURVEY_NO_QUESTION'));
}
// Date
if (!($survey_end = strptime($_POST['survey_end'], __('PUBLISH_EVENT_DATE_FORMAT')))) {
throw new Exception(__('POST_ADD_ERROR_SURVEY_DATE'));
}
$survey_end = mktime($survey_end['tm_hour'], $survey_end['tm_min'], 0, $survey_end['tm_mon'] + 1, $survey_end['tm_mday'], $survey_end['tm_year'] + 1900);
// Multiple answers
$survey_multiple = isset($_POST['survey_multiple']);
// Answers
$survey_answers = array();
foreach ($_POST['survey_answer'] as $survey_answer) {
$survey_answer = trim($survey_answer);
if ($survey_answer != '') {
$survey_answers[] = $survey_answer;
}
}
if (count($survey_answers) < 2) {
throw new Exception(__('POST_ADD_ERROR_SURVEY_ANSWERS'));
}
$survey = array($survey_question, $survey_end, $survey_multiple, $survey_answers);
} else {
$survey = null;
}
// Creation of the post
$id = $this->model->addPost((int) User_Model::$auth_data['id'], $message, $category, $group, $official, $private);
// Attach files
foreach ($attachments as $attachment) {
$this->model->attachFile($id, $attachment[0], $attachment[1], isset($attachment[2]) ? $attachment[2] : null);
}
// Event
if (isset($event)) {
$this->model->attachEvent($id, $event[0], $event[1], $event[2]);
}
// Survey
if (isset($survey)) {
$this->model->attachSurvey($id, $survey[0], $survey[1], $survey[2], $survey[3]);
}
$this->addJSCode('
parent.location = "' . Config::URL_ROOT . Routes::getPage('home') . '";
');
} catch (Exception $e) {
// Delete all uploading files in tmp
foreach ($uploaded_files as $uploaded_file) {
File::delete($uploaded_file);
}
$this->addJSCode('
with(parent){
Post.errorForm(' . json_encode($e->getMessage()) . ');
}
');
}
}
示例6: __
<?php
if ($empty_post) {
?>
<div id="isepor">
<h1><?php
echo __('ISEPOR_TITLE');
?>
</h1>
<p style="width: 500px; margin-bottom: 20px;">
<?php
echo __('ISEPOR_TEXT');
?>
</p>
<form method="post" action="<?php
echo Config::URL_ROOT . Routes::getPage('isep_or_2');
?>
" id="form-isepor-final" >
<?php
foreach ($questions as $question) {
?>
<div id="question-<?php
echo $question['id'];
?>
">
<h2><?php
echo htmlspecialchars($question['questions']);
?>
:</h2>
<p style="margin: 5px;" itemid="<?php
echo $question['id'];
示例7: isset
}
}
?>
</table>
<br />
<a href="<?php
echo Config::URL_ROOT . Routes::getPage('ical_official', isset($calendar_group) ? array('group' => $calendar_group) : null);
?>
"><img src="<?php
echo Config::URL_STATIC;
?>
images/icons/event.png" alt="" class="icon" /> <?php
echo __('CALENDAR_ICAL_OFFICIAL');
?>
</a><br />
<?php
if ($is_student) {
?>
<a href="<?php
echo Config::URL_ROOT . Routes::getPage('ical_non_official', isset($calendar_group) ? array('group' => $calendar_group) : null);
?>
"><img src="<?php
echo Config::URL_STATIC;
?>
images/icons/event.png" alt="" class="icon" /> <?php
echo __('CALENDAR_ICAL_NON_OFFICIAL');
?>
</a>
<?php
}
示例8: __
<div class="students-promo" >
<h2><?php
echo __('STUDENTS_PROMO') . ' ' . $year;
?>
</h2>
<?php
if (!isset($students[$year])) {
$students[$year] = array();
}
foreach ($students[$year] as $student) {
?>
<a id="<?php
echo $student['student_number'];
?>
" href="<?php
echo Config::URL_ROOT . Routes::getPage('student', array('username' => $student['username']));
?>
" onmouseover="Student.showThumb(this,'<?php
echo $student['avatar_url'];
?>
','<?php
echo $student['student_number'];
?>
','<?php
echo $student['promo'];
?>
')" onmouseout="Student.hiddeThumb();">
<?php
echo htmlspecialchars($student['firstname'] . ' ' . $student['lastname']);
?>
</a><br />
示例9: array
<?php
$data = array();
$data[] = array('value' => '<img src="' . Config::URL_STATIC . 'images/icons/search.png" alt="" class="icon" /> ' . $query, 'url' => Config::URL_ROOT . Routes::getPage('search') . '?q=' . urlencode($query));
foreach ($results as &$result) {
switch ($result['_type']) {
case 'student':
$data[] = array('value' => '<img src="' . Config::URL_STATIC . 'images/icons/user.png" alt="" class="icon" /> ' . htmlspecialchars($result['_source']['firstname'] . ' ' . $result['_source']['lastname']), 'url' => Config::URL_ROOT . Routes::getPage('student', array('username' => $result['_id'])));
break;
case 'group':
$data[] = array('value' => '<img src="' . Config::URL_STATIC . 'images/icons/group.png" alt="" class="icon" /> ' . htmlspecialchars($result['_source']['name']), 'url' => Config::URL_ROOT . Routes::getPage('group', array('group' => $result['_source']['url_name'])));
break;
case 'post':
$data[] = array('value' => '<img src="' . Config::URL_STATIC . 'images/icons/post.png" alt="" class="icon" /> ' . htmlspecialchars(Text::summary($result['_source']['message'], 140, '...', $query)), 'url' => Config::URL_ROOT . Routes::getPage('post', array('id' => $result['_id'])));
break;
}
}
echo json_encode($data);
示例10: __
<h1><?php
echo __('ADMIN_RECONFIRM') . " " . $user;
?>
</h1>
<form action="<?php
echo Config::URL_ROOT . Routes::getPage('admin', array("nav" => $url));
?>
" method="post" id="form_admins">
<label><?php
echo __('SIGNIN_PASSWORD');
?>
</label><input type="password" name="reconfpassword"/>
</form>
示例11: addAttachment
public function addAttachment($param)
{
$this->setView('iframe_add.php');
$is_logged = isset(User_Model::$auth_data);
$is_admin = $is_logged && User_Model::$auth_data['admin'] == '1';
@set_time_limit(0);
$uploaded_files = array();
$attachments = array();
try {
if ($is_admin && isset($param['id']) && isset($_FILES['attachment_photo']) && is_array($_FILES['attachment_photo']['name'])) {
foreach ($_FILES['attachment_photo']['size'] as $size) {
if ($size > Config::UPLOAD_MAX_SIZE_PHOTO) {
throw new Exception(__('POST_ADD_ERROR_PHOTO_SIZE', array('size' => File::humanReadableSize(Config::UPLOAD_MAX_SIZE_PHOTO))));
}
}
if ($filepaths = File::upload('attachment_photo')) {
foreach ($filepaths as $filepath) {
$uploaded_files[] = $filepath;
}
foreach ($filepaths as $i => $filepath) {
$name = isset($_FILES['attachment_photo']['name'][$i]) ? $_FILES['attachment_photo']['name'][$i] : '';
try {
$img = new Image();
$img->load($filepath);
$type = $img->getType();
if ($type == IMAGETYPE_JPEG) {
$ext = 'jpg';
} else {
if ($type == IMAGETYPE_GIF) {
$ext = 'gif';
} else {
if ($type == IMAGETYPE_PNG) {
$ext = 'png';
} else {
throw new Exception();
}
}
}
if ($img->getWidth() > 800) {
$img->setWidth(800, true);
}
$img->save($filepath);
// Thumb
$thumbpath = $filepath . '.thumb';
$img->thumb(Config::$THUMBS_SIZES[0], Config::$THUMBS_SIZES[1]);
$img->setType(IMAGETYPE_JPEG);
$img->save($thumbpath);
unset($img);
$attachments[] = array($filepath, $name, $thumbpath);
$uploaded_files[] = $thumbpath;
} catch (Exception $e) {
throw new Exception(__('POST_ADD_ERROR_PHOTO_FORMAT'));
}
}
}
// Attach files
foreach ($attachments as $attachment) {
$this->model->attachFile($param['id'], $attachment[0], $attachment[1], isset($attachment[2]) ? $attachment[2] : null);
}
$this->addJSCode('
parent.location = "' . Config::URL_ROOT . Routes::getPage('post', array('id' => $param['id'])) . '";
');
}
Post_Model::clearCache();
} catch (Exception $e) {
// Delete all uploading files in tmp
foreach ($uploaded_files as $uploaded_file) {
File::delete($uploaded_file);
}
$this->addJSCode('
with(parent){
Post.errorForm(' . json_encode($e->getMessage()) . ');
}
');
}
}
示例12: isepdorPage
//.........这里部分代码省略.........
$champs[0] = $questions[$i]['questions'];
$champs[1] = $finalList[$questions[$i]['id']][$j]["name"];
$champs[2] = "";
if (!is_numeric($finalList[$questions[$i]['id']][$j]["valid"])) {
$champs[2] = $this->model->getBirthDay($finalList[$questions[$i]['id']][$j]["valid"]);
}
for ($a = 0; $a < 3; $a++) {
$pxX = round($coord[$a]['x1']);
// X
$pxY = round($coord[$a]['y2']);
// Y
ImagettfText($im, round($coord[$a]['h']), 0, $pxX, $pxY, $color, $font, $champs[$a]);
}
imagePng($im, DATA_DIR . Config::DIR_DATA_TMP . "diplome" . $i . $j . ".png", 9);
ImageDestroy($im);
if ($finalList[$questions[$i]['id']][$j]['cmpt'] != $finalList[$questions[$i]['id']][$j + 1]['cmpt']) {
break;
}
}
}
if (self::create_zip($files, DATA_DIR . Config::DIR_DATA_TMP . "diplomesIsepDor.zip", true)) {
foreach ($files as $file) {
File::delete($file);
}
header($_SERVER["SERVER_PROTOCOL"] . " 200 OK");
header("Cache-Control: public");
// needed for i.e.
header("Content-Type: application/zip");
header("Content-Transfer-Encoding: Binary");
header("Content-Length:" . filesize(DATA_DIR . Config::DIR_DATA_TMP . "diplomesIsepDor.zip"));
header("Content-Disposition: attachment; filename=diplomesIsepDor.zip");
readfile(DATA_DIR . Config::DIR_DATA_TMP . "diplomesIsepDor.zip");
File::delete(DATA_DIR . Config::DIR_DATA_TMP . "diplomesIsepDor.zip");
die;
}
foreach ($files as $file) {
File::delete($file);
}
}
/*Code qui export les résultats des isep d'or
*
*/
if (isset($_GET['export'])) {
$db = $this->model->getResult();
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: filename=' . 'Résultats_Isepdor' . '.xls');
header('Pragma: no-cache');
header('Expires: 0');
print '<table border=1 >
<!-- impression des titres de colonnes -->
<TR>
<TD bgcolor="#3366CC">Tour</TD>
<TD bgcolor="#3366CC">Nom du votant</TD>
<TD bgcolor="#3366CC">Catégorie</TD>
<TD bgcolor="#3366CC">Réponse(student)</TD>
<TD bgcolor="#3366CC">Réponse(admin)</TD>
<TD bgcolor="#3366CC">Réponse(assoce)</TD>
<TD bgcolor="#3366CC">Réponse(event)</TD>
</TR>
';
foreach ($db as $champs) {
print '<TR>';
print '<TD>' . $champs['round'] . '</TD>';
print '<TD>' . $champs['username'] . '</TD>';
print '<TD>' . utf8_decode($champs['questions']) . '</TD>';
print '<TD>' . $champs['student_username'] . '</TD>';
print '<TD>' . utf8_decode($champs['admin']) . '</TD>';
print '<TD>' . utf8_decode($champs['assoce']) . '</TD>';
print '<TD>' . utf8_decode($champs['name']) . '</TD>';
print '</TR>';
}
print '</table>';
exit;
}
/*
* Ajout de la police
*/
if (isset($_FILES['font']) && $_FILES['font']['name'] != null) {
if ($_FILES['font']['size'] > Config::UPLOAD_MAX_SIZE_FILE) {
throw new Exception(__('POST_ADD_ERROR_FILE_SIZE', array('size' => File::humanReadableSize(Config::UPLOAD_MAX_SIZE_FILE))));
}
if ($filepaths = File::upload('font')) {
if (!preg_match('#\\.ttf$#i', $filepaths)) {
throw new Exception(__('POST_ADD_ERROR_FILE_FORMAT'));
}
$avatar_path = DATA_DIR . Config::DIR_DATA_STORAGE . Config::DIR_DATA_ADMIN . "font2354.ttf";
$avatar_dir = File::getPath($avatar_path) . "/font2354.ttf";
File::rename($filepaths, $avatar_dir);
} else {
throw new Exception(__('ADMIN_UPLOAD_ERROR'));
}
}
/*Code qui met supprime les champs de la table résultat des isep d'or
*
*/
if (isset($_GET['delete_result'])) {
$this->model->deleteresult();
header("Location: " . Config::URL_ROOT . Routes::getPage('admin', array("nav" => "isepdor")));
}
}
示例13: __
</li>
<li><?php
echo __('ADMIN_ISEPDOR_LASTNAME');
?>
</li>
<li><?php
echo __('ADMIN_ISEPDOR_BORN');
?>
</li>
</ul>
<div id="diplomeCat"> </div>
<div id="diplomeName"> </div>
<div id="diplomeBirth"> </div>
</div>
<a id="saveDiplome" style="cursor:pointer;margin-right:10px,right:5px" >
<img alt="" style="position:relative;top:3px;"src="<?php
echo Config::URL_STATIC . "images/icons/post.png";
?>
"/>
<?php
echo __('USER_EDIT_FORM_SUBMIT');
?>
</a><br/>
</div>
</div>
</div>
<input id="pageUrl" type="hidden" value="<?php
echo Config::URL_ROOT . Routes::getPage('admin', array("nav" => "isepdor"));
?>
" />
示例14: array
echo Config::URL_ROOT . Routes::getPage('group', array('group' => $group['url_name']));
?>
"<?php
if (!isset($current_category)) {
echo ' class="active"';
}
?>
><?php
echo __('POST_CATEGORIES_ALL');
?>
</a></li>
<?php
foreach ($categories as $category) {
?>
<li><a href="<?php
echo Config::URL_ROOT . Routes::getPage('group_posts_category', array('group' => $group['url_name'], 'category' => $category['url_name']));
?>
"<?php
if ($category['url_name'] == $current_category) {
echo ' class="active"';
}
?>
><?php
echo $category['name'];
?>
</a></li>
<?php
}
?>
</ul>
<br /><br />
示例15: array
<div id="post-comment-<?php
echo $id;
?>
" class="post-comment<?php
echo ' post-comment-attachment' . (isset($attachment_id) ? $attachment_id : '0');
?>
">
<a href="<?php
echo $user_url;
?>
" class="avatar"><img src="<?php
echo $avatar_url;
?>
" alt="" /></a>
<a href="<?php
echo Config::URL_ROOT . Routes::getPage('post_comment_delete', array('id' => $id));
?>
" class="post-comment-delete">x</a>
<div class="post-comment-message">
<a href="<?php
echo $user_url;
?>
" class="post-comment-username"><?php
echo htmlspecialchars($firstname . ' ' . $lastname);
?>
</a>
<?php
echo Text::inHTML($message);
?>
<div class="post-comment-info">
<?php