本文整理汇总了PHP中Url::task方法的典型用法代码示例。如果您正苦于以下问题:PHP Url::task方法的具体用法?PHP Url::task怎么用?PHP Url::task使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Url
的用法示例。
在下文中一共展示了Url::task方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: task
public static function task($taskID = null)
{
if ($taskID == null) {
return null;
}
$task = Task::load($taskID);
$title = $task->getTitle();
$projectID = $task->getProjectID();
return array_merge(self::tasks($projectID), self::oneCrumb($title, Url::task($taskID)));
}
示例2:
<p><?php
echo Accepted::getStatusName($accepted->getStatus());
?>
</p>
</div>
</div>
</div>
<div class="edit hidden">
<div class="clear">
<label>Task</label>
<div class="task-info">
<p><a href="<?php
echo Url::task($task->getID());
?>
"><?php
echo $task->getTitle();
?>
</a></p>
</div>
</div>
<div class="clear">
<label>Accepted By</label>
<div class="task-info">
<p><a class="picture small" href="<?php
echo Url::user($task->getLeaderID());
?>
"><img src="<?php
示例3: foreach
echo '<table class="tasks">';
// table heading
echo '<tr>';
echo ' <th style="padding-left: 22px;">Task</th>';
echo ' <th>Status</th>';
echo ' <th>Deadline</th>';
echo ' <th>Needed</th>';
if (!is_null($user)) {
echo ' <th>Role</th>';
}
echo '</tr>';
foreach ($tasks as $t) {
echo '<tr>';
// title
echo '<td class="name">';
echo '<h6><a href="' . Url::task($t->getID()) . '">' . $t->getTitle() . '</a></h6>';
if (is_null($project)) {
// project
$ptitle = Project::load($t->getProjectID())->getTitle();
echo '<p>in <a href="' . Url::project($t->getProjectID()) . '">' . $ptitle . '</a></p>';
} else {
// description
echo '<p>';
$description = strip_tags(formatTaskDescription($t->getDescription()));
echo substr($description, 0, 70);
if (strlen($description) > 70) {
echo '…';
}
echo '</p>';
}
echo '</td>';
示例4: formatEvent
//.........这里部分代码省略.........
} else {
$predicate = $showProject ? 'the project ' . formatProjectLink($event->getProjectID()) : 'this project';
$formatted = sprintf("%s removed the %s for %s.", formatUserLink($event->getUser1ID(), $event->getProjectID()), '<a href="' . Url::deadline($event->getProjectID()) . '">deadline</a>', $predicate);
}
break;
case 'create_discussion':
$predicate = $showProject ? ' in the project ' . formatProjectLink($event->getProjectID()) : '';
$discussion = Discussion::load($event->getItem1ID());
$title = $discussion->getTitle();
$url = Url::discussion($discussion->getID());
$formatted = sprintf("%s posted the discussion %s%s.", formatUserLink($event->getUser1ID(), $event->getProjectID()), '<a href="' . $url . '">' . $title . '</a>', $predicate);
break;
case 'lock_discussion':
$predicate = $showProject ? ' in the project ' . formatProjectLink($event->getProjectID()) : '';
$discussion = Discussion::load($event->getItem1ID());
$title = $discussion->getTitle();
$url = Url::discussion($discussion->getID());
$formatted = sprintf("%s locked the discussion %s%s.", formatUserLink($event->getUser1ID(), $event->getProjectID()), '<a href="' . $url . '">' . $title . '</a>', $predicate);
break;
case 'unlock_discussion':
$predicate = $showProject ? ' in the project ' . formatProjectLink($event->getProjectID()) : '';
$discussion = Discussion::load($event->getItem1ID());
$title = $discussion->getTitle();
$url = Url::discussion($discussion->getID());
$formatted = sprintf("%s unlocked the discussion %s%s.", formatUserLink($event->getUser1ID(), $event->getProjectID()), '<a href="' . $url . '">' . $title . '</a>', $predicate);
break;
case 'create_discussion_reply':
$predicate = $showProject ? ' in the project ' . formatProjectLink($event->getProjectID()) : '';
$discussion = Discussion::load($event->getItem2ID());
$title = $discussion->getTitle();
$url = Url::discussion($discussion->getID());
$formatted = sprintf("%s replied to the discussion %s%s.", formatUserLink($event->getUser1ID(), $event->getProjectID()), '<a href="' . $url . '">' . $title . '</a>', $predicate);
break;
case 'create_task':
$predicate = $showProject ? ' in the project ' . formatProjectLink($event->getProjectID()) : '';
$task = Task::load($event->getItem1ID());
$title = $task->getTitle();
$url = Url::task($task->getID());
$formatted = sprintf("%s created the task %s%s.", formatUserLink($event->getUser1ID(), $event->getProjectID()), '<a href="' . $url . '">' . $title . '</a>', $predicate);
break;
case 'edit_task_title':
$predicate = $showProject ? ' in the project ' . formatProjectLink($event->getProjectID()) : '';
$task = Task::load($event->getItem1ID());
$title = $task->getTitle();
$url = Url::task($task->getID());
$formatted = sprintf("%s edited the name of the task %s%s.", formatUserLink($event->getUser1ID(), $event->getProjectID()), '<a href="' . $url . '">' . $title . '</a>', $predicate);
break;
case 'edit_task_status':
$predicate = $showProject ? ' in the project ' . formatProjectLink($event->getProjectID()) : '';
$task = Task::load($event->getItem1ID());
$title = $task->getTitle();
$url = Url::task($task->getID());
$status = $event->getData2();
if ($status == Task::STATUS_CLOSED) {
$formatted = sprintf("%s closed the task %s%s.", formatUserLink($event->getUser1ID(), $event->getProjectID()), '<a href="' . $url . '">' . $title . '</a>', $predicate);
} else {
$formatted = sprintf("%s opened the task %s%s.", formatUserLink($event->getUser1ID(), $event->getProjectID()), '<a href="' . $url . '">' . $title . '</a>', $predicate);
}
break;
case 'edit_task_num_needed':
$predicate = $showProject ? ' in the project ' . formatProjectLink($event->getProjectID()) : '';
$task = Task::load($event->getItem1ID());
$title = $task->getTitle();
$url = Url::task($task->getID());
$numNeeded = $event->getData2();
if ($numNeeded != '') {
示例5: formatComment
$body .= "<blockquote>" . formatComment($message) . "</blockquote>";
$email = array('to' => $leader->getEmail(), 'subject' => '[' . PIPELINE_NAME . '] New comment reply on a task you are leading in ' . $project->getTitle(), 'message' => $body);
// send email
Email::send($email);
}
}
// to task crew
$crew = Accepted::getByTaskID($taskID);
if ($crew != null) {
foreach ($crew as $c) {
$user = User::load($c->getCreatorID());
if ($user->getID() != Session::getUserID()) {
// don't email yourself
if ($user->getNotifyCommentTaskAccepted()) {
// compose email
$body = "<p>" . formatUserLink(Session::getUserID()) . ' replied to a comment on the task <a href="' . Url::task($taskID) . '">' . $task->getTitle() . '</a> in the project ' . formatProjectLink($project->getID()) . '. The reply was:</p>';
$body .= "<blockquote>" . formatComment($message) . "</blockquote>";
$email = array('to' => $user->getEmail(), 'subject' => '[' . PIPELINE_NAME . '] New comment reply on a task you joined in ' . $project->getTitle(), 'message' => $body);
// send email
Email::send($email);
}
}
}
}
// send us back
Session::setMessage('You replied to a comment on this task.');
$json = array('success' => '1');
echo json_encode($json);
}
} else {
$json = array('error' => 'Invalid action.');
示例6: getUploadCssClass
$(this).parent().parent().find('a.thumb.preview').click();
return false;
});
});
</script>
<div id="flowplayer" style="overflow: hidden;"></div>
<div id="imageviewer" style="overflow: hidden;"></div>
<div id="flashviewer"></div>
<?php
function getUploadCssClass($ext)
{
$className = '';
switch ($ext) {
case 'jpg':
case 'jpeg':
case 'png':
case 'gif':
$className = 'image';
break;
case 'mp3':
$className = 'audio';
break;
case 'fla':
case 'swf':
case 'flv':
$className = 'flash';
break;
case 'mpeg':
case 'mp4':
case '3gp':
case 'mpg':