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


PHP Url::update方法代码示例

本文整理汇总了PHP中Url::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Url::update方法的具体用法?PHP Url::update怎么用?PHP Url::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Url的用法示例。


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

示例1: update

 public static function update($updateID = null)
 {
     if ($updateID == null) {
         return null;
     }
     $update = Update::load($updateID);
     //	$user = User::load($update->getCreatorID());
     //	$username = $user->getUsername();
     $title = $update->getTitle();
     $accepted = Accepted::load($update->getAcceptedID());
     return array_merge(self::task($accepted->getTaskID()), self::oneCrumb($title, Url::update($updateID)));
 }
开发者ID:malimu,项目名称:Pipeline,代码行数:12,代码来源:breadcrumbs.class.php

示例2: array

        $json = array('error' => 'Your reply cannot be empty.');
        exit(json_encode($json));
    } else {
        // post the comment
        $reply = new Comment(array('creator_id' => Session::getUserID(), 'project_id' => $project->getID(), 'update_id' => $updateID, 'parent_id' => $commentID, 'message' => $message));
        $reply->save();
        // log it
        $logEvent = new Event(array('event_type_id' => 'create_update_comment_reply', 'project_id' => $project->getID(), 'user_1_id' => Session::getUserID(), 'item_1_id' => $commentID, 'item_2_id' => $reply->getID(), 'item_3_id' => $updateID, 'data_1' => $message));
        $logEvent->save();
        // send email notification, if desired
        $creator = User::load($update->getCreatorID());
        if ($creator->getID() != Session::getUserID()) {
            // don't email yourself
            if ($creator->getNotifyCommentTaskUpdate()) {
                // compose email
                $msg = "<p>" . formatUserLink(Session::getUserID()) . ' replied to a comment on your task update <a href="' . Url::update($updateID) . '">' . $update->getTitle() . '</a> in the project ' . formatProjectLink($project->getID()) . '. The reply was:</p>';
                $msg .= "<blockquote>" . formatUpdate($message) . "</blockquote>";
                $email = array('to' => $creator->getEmail(), 'subject' => '[' . PIPELINE_NAME . '] New comment reply on your task update in ' . $project->getTitle(), 'message' => $msg);
                // send email
                Email::send($email);
            }
        }
        // send us back
        Session::setMessage('You replied to a comment on this update.');
        $json = array('success' => '1');
        echo json_encode($json);
    }
} else {
    $json = array('error' => 'Action not recognized.');
    exit(json_encode($json));
}
开发者ID:malimu,项目名称:Pipeline,代码行数:31,代码来源:update.process.php

示例3: formatEvent


//.........这里部分代码省略.........
            break;
        case 'edit_task_deadline':
            $predicate = $showProject ? ' in the project ' . formatProjectLink($event->getProjectID()) : '';
            $task = Task::load($event->getItem1ID());
            $title = $task->getTitle();
            $url = Url::task($task->getID());
            $deadline = $event->getData2();
            if ($deadline != '') {
                $formatted = sprintf("%s changed the deadline for the task %s%s to %s.", formatUserLink($event->getUser1ID(), $event->getProjectID()), '<a href="' . $url . '">' . $title . '</a>', $predicate, strftime("%a, %b %d, %Y", strtotime($deadline)));
            } else {
                $formatted = sprintf("%s removed the deadline for the task %s%s.", formatUserLink($event->getUser1ID(), $event->getProjectID()), '<a href="' . $url . '">' . $title . '</a>', $predicate);
            }
            break;
        case 'accept_task':
            $predicate = $showProject ? ' in the project ' . formatProjectLink($event->getProjectID()) : '';
            $accepted = Accepted::load($event->getItem1ID());
            //$acceptedUrl = Url::updates($accepted->getID());
            $task = Task::load($event->getItem2ID());
            $taskTitle = $task->getTitle();
            $taskUrl = Url::task($task->getID());
            $formatted = sprintf("%s joined the task %s%s.", formatUserLink($event->getUser1ID(), $event->getProjectID()), '<a href="' . $taskUrl . '">' . $taskTitle . '</a>', $predicate);
            break;
        case 'release_task':
            $predicate = $showProject ? ' in the project ' . formatProjectLink($event->getProjectID()) : '';
            $accepted = Accepted::load($event->getItem1ID());
            //$acceptedUrl = Url::updates($accepted->getID());
            $task = Task::load($event->getItem2ID());
            $taskTitle = $task->getTitle();
            $taskUrl = Url::task($task->getID());
            $formatted = sprintf("%s left the task %s%s.", formatUserLink($event->getUser1ID(), $event->getProjectID()), '<a href="' . $taskUrl . '">' . $taskTitle . '</a>', $predicate);
            break;
        case 'edit_accepted_status':
            $predicate = $showProject ? ' in the project ' . formatProjectLink($event->getProjectID()) : '';
            $update = Update::load($event->getItem1ID());
            $updateTitle = $update->getTitle();
            $updateUrl = Url::update($update->getID());
            $accepted = Accepted::load($event->getItem2ID());
            $task = Task::load($event->getItem3ID());
            $taskTitle = $task->getTitle();
            $taskUrl = Url::task($task->getID());
            $status = $event->getData2();
            if ($status == Accepted::STATUS_FEEDBACK) {
                $formatted = sprintf("%s is seeking feedback on his/her work on the task %s%s.", formatUserLink($event->getUser1ID(), $event->getProjectID()), '<a href="' . $taskUrl . '">' . $taskTitle . '</a>', $predicate);
            } elseif ($status == Accepted::STATUS_COMPLETED) {
                $formatted = sprintf("%s is finished working on the task %s%s.", formatUserLink($event->getUser1ID(), $event->getProjectID()), '<a href="' . $taskUrl . '">' . $taskTitle . '</a>', $predicate);
            } elseif ($status == Accepted::STATUS_PROGRESS) {
                $formatted = sprintf("%s is working on the task %s%s.", formatUserLink($event->getUser1ID(), $event->getProjectID()), '<a href="' . $taskUrl . '">' . $taskTitle . '</a>', $predicate);
            }
            break;
        case 'create_task_comment':
            $predicate = $showProject ? ' in the project ' . formatProjectLink($event->getProjectID()) : '';
            $task = Task::load($event->getItem2ID());
            $title = $task->getTitle();
            $url = Url::task($task->getID());
            $formatted = sprintf("%s commented on the task %s%s.", formatUserLink($event->getUser1ID(), $event->getProjectID()), '<a href="' . $url . '">' . $title . '</a>', $predicate);
            break;
        case 'create_task_comment_reply':
            $predicate = $showProject ? ' in the project ' . formatProjectLink($event->getProjectID()) : '';
            $task = Task::load($event->getItem3ID());
            $title = $task->getTitle();
            $url = Url::task($task->getID());
            $formatted = sprintf("%s replied to a comment on the task %s%s.", formatUserLink($event->getUser1ID(), $event->getProjectID()), '<a href="' . $url . '">' . $title . '</a>', $predicate);
            break;
        case 'create_update_comment':
            $predicate = $showProject ? ' in the project ' . formatProjectLink($event->getProjectID()) : '';
            $update = Update::load($event->getItem2ID());
开发者ID:malimu,项目名称:Pipeline,代码行数:67,代码来源:formatEvents.php

示例4: foreach

<?php 
if (!empty($joined)) {
    echo '<div class="line"></div>';
    echo '<ul class="segmented-list users">';
}
// contributors
if ($joined != null) {
    foreach ($joined as $j) {
        echo '<li>';
        echo formatUserPicture($j->getCreatorID(), 'small');
        echo '<h6 class="primary">' . formatUserLink($j->getCreatorID(), $project->getID()) . '</h6>';
        $numUpdates = count($j->getUpdates());
        $latestUpdate = $j->getLatestUpdate();
        if (!empty($latestUpdate)) {
            echo '<p class="secondary contribution"><a href="' . Url::update($latestUpdate->getID()) . '">last contributed ' . formatTimeTag($latestUpdate->getDateCreated()) . '</a> <span class="slash">/</span> ' . $numUpdates . ' total</p>';
            //	echo '<h6 class="primary"><a href="'.Url::update($latestUpdate->getID()).'">'.$latestUpdate->getTitle().'</a></h6>';
            //	echo '<p class="secondary">posted '.formatTimeTag($latestUpdate->getDateCreated()).' by '.formatUserLink($latestUpdate->getCreatorID(), $latestUpdate->getProjectID()).'</p>';
        } else {
            echo '<p class="secondary">no contributions <span class="slash">/</span> joined ' . formatTimeTag($j->getDateCreated()) . '</p>';
        }
        echo '</li>';
    }
}
if (!empty($joined)) {
    echo '</ul>';
}
?>

</div>
开发者ID:malimu,项目名称:Pipeline,代码行数:29,代码来源:taskContributors.tpl.php

示例5: foreach

';
	});
});

</script>

<?php 
}
?>

<?php 
if ($updates != null) {
    echo '<ul class="segmented-list updates">';
    foreach ($updates as $u) {
        echo '<li>';
        echo '<h6 class="primary"><a href="' . Url::update($u->getID()) . '">' . $u->getTitle() . '</a>';
        if ($u->isLatestUpdate()) {
            $accept = Accepted::load($u->getAcceptedID());
            $statusName = Accepted::getStatusName($accept->getStatus());
            echo ' <span class="status">' . $statusName . '</span>';
        }
        echo '</h6>';
        // .primary
        echo '<p class="secondary">';
        echo 'posted ' . formatTimeTag($u->getDateCreated());
        $comments = $u->getComments();
        echo ' <span class="slash">/</span> ' . formatCount(count($comments), 'comment', 'comments', 'no');
        echo '</p>';
        // .secondary
        echo '</li>';
    }
开发者ID:malimu,项目名称:Pipeline,代码行数:31,代码来源:userUpdates.tpl.php

示例6: foreach

	$('#<?php 
    echo $id;
    ?>
 .createButton').click(function(){
		window.location = '<?php 
    echo Url::updateNew($task->getID());
    ?>
';
	});
<?php 
}
?>

</script>
<?php 
if (!empty($contribs)) {
    ?>

<table class="contribs">
	<tr>
		<th style="padding-left: 22px;">Contribution</th>
		<th>Member</th>
		<th>Status</th>
		<th>Date</th>
	</tr>
<?php 
    foreach ($contribs as $c) {
        echo '<tr>';
        // title
        echo '<td class="name">';
开发者ID:malimu,项目名称:Pipeline,代码行数:30,代码来源:contribs.tpl.php

示例7: getUploadCssClass

});
</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':
        case 'mov':
        case 'avi':
            $className = 'video';
开发者ID:malimu,项目名称:Pipeline,代码行数:31,代码来源:newUploads.tpl.php


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