本文整理汇总了PHP中Url::tasks方法的典型用法代码示例。如果您正苦于以下问题:PHP Url::tasks方法的具体用法?PHP Url::tasks怎么用?PHP Url::tasks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Url
的用法示例。
在下文中一共展示了Url::tasks方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tasks
public static function tasks($projectID = null)
{
if ($projectID == null) {
return null;
}
return self::oneCrumb("Tasks", Url::tasks($projectID));
}
示例2: array
<script type="text/javascript">
$(document).ready(function(){
$('#selTaskFilesPages').change(function(){
var url = '<?php
echo $thisURL;
?>
';
var pageNum = $(this).val();
window.location = url+'/'+pageNum;
});
});
</script>
<?php
if (empty($uploads)) {
echo '<p>None yet. To upload files, <a href="' . Url::taskNew($project->getID()) . '">create a task</a> or contribute to an <a href="' . Url::tasks($project->getID()) . '">existing task</a>.</p>';
} else {
$SOUP->render('site/partial/newUploads', array('showParent' => true));
}
?>
<?php
$fork->endBlockSet();
// pagination, if necessary
if ($numPages > 1) {
$fork->startBlockSet('footer');
if ($page != 1) {
$olderURL = $thisURL;
$olderURL .= '/' . ($page - 1);
echo '<a href="' . $olderURL . '">« Previous</a> ';
}
示例3: array
$logEvent->save();
// send us back
Session::setMessage('You joined the task. Good luck!');
$json = array('success' => '1', 'successUrl' => Url::task($taskID));
echo json_encode($json);
} elseif ($action == 'release') {
$accepted = Accepted::getByUserID(Session::getUserID(), $taskID);
if (!empty($accepted)) {
$accepted->setStatus(Accepted::STATUS_RELEASED);
$accepted->save();
// log it
$logEvent = new Event(array('event_type_id' => 'release_task', 'project_id' => $project->getID(), 'user_1_id' => Session::getUserID(), 'item_1_id' => $accepted->getID(), 'item_2_id' => $taskID));
$logEvent->save();
// send us back
Session::setMessage('You left the task.');
$json = array('success' => '1', 'successUrl' => Url::tasks($project->getID()));
echo json_encode($json);
} else {
$json = array('error' => 'You never joined that task.');
exit(json_encode($json));
}
} elseif ($action == 'comment') {
$message = Filter::formattedText($_POST['message']);
if ($message == '') {
$json = array('error' => 'Your comment cannot be empty.');
exit(json_encode($json));
} else {
// post the comment
$comment = new Comment(array('creator_id' => Session::getUserID(), 'project_id' => $project->getID(), 'task_id' => $taskID, 'message' => $message));
$comment->save();
// re-save now that we have an ID
示例4: Task
$task = new Task(array('creator_id' => Session::getUserID(), 'leader_id' => $leaderId, 'project_id' => $projectId, 'title' => $title, 'description' => $description, 'status' => 1, 'deadline' => $deadline, 'num_needed' => $numberOfPeople));
array_push($taskArray, $task);
//Increment row in file
$row++;
}
fclose($handle);
}
//Save each task to the database if no errors are found
if ($errorFound == 1) {
$errorString = "<strong><span class='bad'>Your CSV file was not uploaded.</span></strong><br/>" . $errorString;
$json = array("error" => $errorString);
exit(json_encode($json));
} else {
foreach ($taskArray as $task) {
$task->save();
}
//Send back success message
Session::setMessage("File successfully uploaded.");
//header('Location: '.Url::tasks($projectId));
$json = array('success' => '1', 'url' => Url::tasks($projectId));
exit(json_encode($json));
}
if (empty($json)) {
$json = array('success' => '1');
}
exit(json_encode($json));
} else {
header('Location: ' . Url::error());
exit;
}
}
示例5: formatSectionLink
function formatSectionLink($sectionID = null, $projectID = null)
{
if ($sectionID == null || $projectID == null) {
return null;
}
switch ($sectionID) {
case ACTIVITY_ID:
$url = Url::activity($projectID);
$name = "Activity";
break;
case BASICS_ID:
$url = Url::details($projectID);
$name = "Basics";
break;
case TASKS_ID:
$url = Url::tasks($projectID);
$name = "Tasks";
break;
case DISCUSSIONS_ID:
$url = Url::discussions($projectID);
$name = "Discussions";
break;
case PEOPLE_ID:
$url = Url::people($projectID);
$name = "People";
break;
}
$formatted = '<a href="' . $url . '">' . $name . '</a>';
return $formatted;
}
示例6: Event
// Upload::TYPE_DISCUSSION,
// $discussion->getID(),
// $project->getID()
// );
// log it
$logEvent = new Event(array('event_type_id' => 'create_discussion', 'project_id' => $project->getID(), 'user_1_id' => Session::getUserID(), 'item_1_id' => $discussion->getID(), 'data_1' => $title, 'data_2' => $message));
$logEvent->save();
// we're done here
Session::setMessage('You created a new discussion.');
// if category is set, redirect back to other section
switch ($cat) {
case BASICS_ID:
$successURL = Url::details($project->getID());
break;
case TASKS_ID:
$successURL = Url::tasks($project->getID());
break;
case PEOPLE_ID:
$successURL = Url::people($project->getID());
break;
case ACTIVITY_ID:
$successURL = Url::activity($project->getID());
break;
default:
$successURL = Url::discussion($discussion->getID());
}
$json = array('success' => '1', 'successUrl' => $successURL);
echo json_encode($json);
} elseif ($action == 'reply') {
$discussionID = Filter::numeric($_POST['discussionID']);
$message = Filter::formattedText($_POST['message']);
示例7:
<ul>
<?php
if ($project != null) {
?>
<li><a <?php
echo $selected == "details" ? 'class="selected"' : '';
?>
href="<?php
echo Url::details($project->getID());
?>
">Basics</a></li>
<li><a <?php
echo $selected == "tasks" ? 'class="selected"' : '';
?>
href="<?php
echo Url::tasks($project->getID());
?>
">Tasks</a></li>
<li><a <?php
echo $selected == "people" ? 'class="selected"' : '';
?>
href="<?php
echo Url::people($project->getID());
?>
">People</a></li>
<li><a <?php
echo $selected == "discussions" ? 'class="selected"' : '';
?>
href="<?php
echo Url::discussions($project->getID());
?>