當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Sprite函數代碼示例

本文整理匯總了PHP中Sprite函數的典型用法代碼示例。如果您正苦於以下問題:PHP Sprite函數的具體用法?PHP Sprite怎麽用?PHP Sprite使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了Sprite函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: ToString

 public function ToString()
 {
     $Session = Gdn::Session();
     $Controller = Gdn::Controller();
     $UserID = $Controller->User->UserID;
     $MemberOptions = array();
     $ProfileOptions = array();
     $Controller->EventArguments['UserID'] = $UserID;
     $Controller->EventArguments['ProfileOptions'] =& $ProfileOptions;
     $Controller->EventArguments['MemberOptions'] =& $MemberOptions;
     if ($Controller->EditMode) {
         return '<div class="ProfileOptions">' . Anchor(T('Back to Profile'), UserUrl($Controller->User), array('class' => 'ProfileButtons')) . '</div>';
         //         $ProfileOptions[] = array('Text' => T('Back to Profile'), 'Url' => UserUrl($Controller->User), 'CssClass' => 'BackToProfile');
     } else {
         // Profile Editing
         if (hasEditProfile($Controller->User->UserID)) {
             $ProfileOptions[] = array('Text' => Sprite('SpEditProfile') . ' ' . T('Edit Profile'), 'Url' => UserUrl($Controller->User, '', 'edit'));
         }
         // Ban/Unban
         $MayBan = CheckPermission('Garden.Moderation.Manage') || CheckPermission('Garden.Users.Edit') || CheckPermission('Moderation.Users.Ban');
         if ($MayBan && $UserID != $Session->UserID) {
             if ($Controller->User->Banned) {
                 $ProfileOptions[] = array('Text' => Sprite('SpBan') . ' ' . T('Unban'), 'Url' => "/user/ban?userid={$UserID}&unban=1", 'CssClass' => 'Popup');
             } elseif (!$Controller->User->Admin) {
                 $ProfileOptions[] = array('Text' => Sprite('SpBan') . ' ' . T('Ban'), 'Url' => "/user/ban?userid={$UserID}", 'CssClass' => 'Popup');
             }
         }
         // Delete content.
         if (CheckPermission('Garden.Moderation.Manage')) {
             $ProfileOptions[] = array('Text' => Sprite('SpDelete') . ' ' . T('Delete Content'), 'Url' => "/user/deletecontent?userid={$UserID}", 'CssClass' => 'Popup');
         }
     }
     return parent::ToString();
 }
開發者ID:3marproof,項目名稱:vanilla,代碼行數:34,代碼來源:class.profileoptionsmodule.php

示例2: profileController_beforeProfileOptions_handler

 /**
  * Add "Signature Settings" to Profile Edit button group.
  * Only do this if they cannot edit profiles because otherwise they can't navigate there.
  *
  * @param $Sender
  */
 public function profileController_beforeProfileOptions_handler($Sender, $Args)
 {
     $CanEditProfiles = CheckPermission('Garden.Users.Edit') || CheckPermission('Moderation.Profiles.Edit');
     if (CheckPermission('Moderation.Signatures.Edit') && !$CanEditProfiles) {
         $Args['ProfileOptions'][] = array('Text' => Sprite('SpSignatures') . ' ' . T('Signature Settings'), 'Url' => UserUrl($Sender->User, '', 'signature'));
     }
 }
開發者ID:jamesinc,項目名稱:addons,代碼行數:13,代碼來源:class.signatures.plugin.php

示例3: WriteHomepageOption

function WriteHomepageOption($Title, $Url, $CssClass, $Current, $Description = '')
{
    $SpriteClass = $CssClass;
    if ($Current == $Url) {
        $CssClass .= ' Current';
    }
    echo Anchor(T($Title) . Wrap(Sprite($SpriteClass), 'span', array('class' => 'Wrap')), $Url, array('class' => $CssClass, 'title' => $Description));
}
開發者ID:rnovino,項目名稱:Garden,代碼行數:8,代碼來源:homepage.php

示例4: Base_AfterDiscussionFilters_Handler

 /**
  * Add 'Unanswered' option to discussion filters.
  */
 public function Base_AfterDiscussionFilters_Handler($Sender, $Args)
 {
     if (Gdn::Session()->CheckPermission('Garden.Moderation.Manage')) {
         $DiscussionModel = new DiscussionModel();
         $Active = $Controller->RequestMethod == 'unanswered' ? ' Active' : '';
         $Unanswered = Sprite('SpUnansweredQuestionsSpUnansweredQuestions') . ' ' . T('Unanswered') . FilterCountString($DiscussionModel->UnansweredCount());
         echo '<li class="Unanswered ' . $Active . '">' . Anchor($Unanswered, 'discussions/unanswered') . '</li>';
     }
 }
開發者ID:nilsen,項目名稱:addons,代碼行數:12,代碼來源:class.supporttracker.plugin.php

示例5: MeModule_FlyoutMenu_Handler

 /**
  * Adds "Mark All Viewed" and (conditionally) "Mark Category Viewed" to MeModule menu.
  *
  * @since 2.0
  * @access public
  */
 public function MeModule_FlyoutMenu_Handler($Sender)
 {
     // Add "Mark All Viewed" to menu
     if (Gdn::Session()->IsValid()) {
         echo Wrap(Anchor(Sprite('SpMarkAllViewed') . ' ' . T('Mark All Viewed'), '/discussions/markallviewed'), 'li', array('class' => 'MarkAllViewed'));
         $CategoryID = (int) (empty(Gdn::Controller()->CategoryID) ? 0 : Gdn::Controller()->CategoryID);
         if ($CategoryID > 0) {
             echo Wrap(Anchor(Sprite('SpMarkCategoryViewed') . ' ' . T('Mark Category Viewed'), "/discussions/markcategoryviewed/{$CategoryID}"), 'li', array('class' => 'MarkCategoryViewed'));
         }
     }
 }
開發者ID:3marproof,項目名稱:vanilla,代碼行數:17,代碼來源:class.allviewed.plugin.php

示例6: Index

 /**
  * General "post" form, allows posting of any kind of form. Attach to PostController_AfterFormCollection_Handler.
  *
  * @since 2.0.0
  * @access public
  */
 public function Index($CurrentFormName = 'discussion')
 {
     $this->AddJsFile('jquery.autosize.min.js');
     $this->AddJsFile('post.js');
     $this->AddJsFile('autosave.js');
     $this->SetData('CurrentFormName', $CurrentFormName);
     $Forms = array();
     $Forms[] = array('Name' => 'Discussion', 'Label' => Sprite('SpNewDiscussion') . T('New Discussion'), 'Url' => 'vanilla/post/discussion');
     /*
     $Forms[] = array('Name' => 'Question', 'Label' => Sprite('SpAskQuestion').T('Ask Question'), 'Url' => 'vanilla/post/discussion');
     $Forms[] = array('Name' => 'Poll', 'Label' => Sprite('SpNewPoll').T('New Poll'), 'Url' => 'activity');
     */
     $this->SetData('Forms', $Forms);
     $this->FireEvent('AfterForms');
     $this->SetData('Breadcrumbs', array(array('Name' => T('Post'), 'Url' => '/post')));
     $this->Render();
 }
開發者ID:embo-hd,項目名稱:vanilla,代碼行數:23,代碼來源:class.postcontroller.php

示例7: AddSendMessageButton

 /**
  * Output Send Message link.
  */
 protected function AddSendMessageButton($Sender, $Args)
 {
     if (!Gdn::Session()->UserID) {
         return;
     }
     if (isset($Args['Comment'])) {
         $Object = $Args['Comment'];
         $ObjectID = 'Comment_' . $Args['Comment']->CommentID;
     } else {
         if (isset($Args['Discussion'])) {
             $Object = $Args['Discussion'];
             $ObjectID = 'Discussion_' . $Args['Discussion']->DiscussionID;
         } else {
             return;
         }
     }
     echo Anchor(Sprite('ReactMessage', 'ReactSprite') . T('Send Message'), Url("/messages/add/{$Object->InsertName}", TRUE), 'ReactButton Visible SendMessage') . ' ';
 }
開發者ID:SatiricMan,項目名稱:addons,代碼行數:21,代碼來源:class.messagelink.plugin.php

示例8: ToString

 public function ToString()
 {
     $Session = Gdn::Session();
     $Controller = Gdn::Controller();
     $UserID = $Controller->User->UserID;
     $MemberOptions = array();
     $ProfileOptions = array();
     $Controller->EventArguments['UserID'] = $UserID;
     $Controller->EventArguments['ProfileOptions'] =& $ProfileOptions;
     $Controller->EventArguments['MemberOptions'] =& $MemberOptions;
     if ($Controller->EditMode) {
         $ProfileOptions[] = array('Text' => T('Back to Profile'), 'Url' => UserUrl($Controller->User), 'CssClass' => 'BackToProfile');
     } else {
         if ($Controller->User->UserID != $Session->UserID) {
             if ($Session->CheckPermission('Garden.Users.Edit')) {
                 $ProfileOptions[] = array('Text' => Sprite('SpEditProfile') . T('Edit Profile'), 'Url' => UserUrl($Controller->User, '', 'edit'));
             }
         } else {
             if (C('Garden.UserAccount.AllowEdit')) {
                 $ProfileOptions[] = array('Text' => Sprite('SpEditProfile') . T('Edit Profile'), 'Url' => '/profile/edit');
             }
         }
         if ($Session->CheckPermission('Garden.Moderation.Manage') && $UserID != $Session->UserID) {
             // Ban/Unban
             if ($Controller->User->Banned) {
                 $ProfileOptions[] = array('Text' => Sprite('SpBan') . T('Unban'), 'Url' => "/user/ban?userid={$UserID}&unban=1", 'CssClass' => 'Popup');
             } else {
                 $ProfileOptions[] = array('Text' => Sprite('SpBan') . T('Ban'), 'Url' => "/user/ban?userid={$UserID}", 'CssClass' => 'Popup');
             }
             // Delete content.
             if (!$Controller->User->Banned) {
                 $ProfileOptions[] = array('Text' => Sprite('SpDelete') . T('Delete Content'), 'Url' => "/user/deletecontent?userid={$UserID}", 'CssClass' => 'Popup');
             }
         }
     }
     return parent::ToString();
 }
開發者ID:rnovino,項目名稱:Garden,代碼行數:37,代碼來源:class.profileoptionsmodule.php

示例9: Anchor

         </div>
      </li>
      <?php 
    }
    ?>
   </ul>   
   <div class="P PagerContainer">
      <?php 
    echo Anchor(Sprite('SpNewConversation SpAdd') . T('New Message'), '/messages/add');
    ?>
      <span class="Pager"><?php 
    echo Anchor(T('More…'), '/messages/inbox');
    ?>
</span>
   </div>
   <?php 
} else {
    ?>
      <?php 
    echo Wrap(T('Your private conversations with other members.'), 'div', array('class' => 'P'));
    ?>
      <div class="P PagerContainer">
         <?php 
    echo Anchor(Sprite('SpNewConversation SpAdd') . T('New Message'), '/messages/add');
    ?>
      </div>
   <?php 
}
?>
</div>
開發者ID:bishopb,項目名稱:vanilla,代碼行數:30,代碼來源:inbox.php

示例10: array

<h1 class="H"><?php 
echo $this->Data('Title');
?>
</h1>
<?php 
// Pager setup
$PagerOptions = array('CurrentRecords' => count($this->Data('Conversations')));
if ($this->Data('_PagerUrl')) {
    $PagerOptions['Url'] = $this->Data('_PagerUrl');
}
// Pre Pager
echo '<div class="PageControls Top">';
PagerModule::Write($PagerOptions);
if (CheckPermission('Conversations.Conversations.Add')) {
    echo '<div class="BoxButtons BoxNewConversation">';
    echo Anchor(Sprite('SpMessage') . ' ' . T('New Message'), '/messages/add', 'Button NewConversation Primary');
    echo '</div>';
}
echo '</div>';
?>
<div class="DataListWrap">
<h2 class="Hidden"><?php 
echo $this->Data('Title');
?>
</h2>
<ul class="Condensed DataList Conversations">
<?php 
if (count($this->Data('Conversations') > 0)) {
    $ViewLocation = $this->FetchViewLocation('conversations');
    include $ViewLocation;
} else {
開發者ID:edward-tsai,項目名稱:vanilla4china,代碼行數:31,代碼來源:all.php

示例11: MenuOptions

 public function MenuOptions(&$Options, $UserID, $Key = NULL, $Label = NULL)
 {
     if (Gdn::Session()->CheckPermission('Garden.Moderation.Manage')) {
         $Options[$Key] = array('Label' => Sprite('WarningSprite') . ' ' . ($Label ? $Label : T('Warning.GiveWarning', 'Give Warning')), 'Text' => Sprite('WarningSprite') . ' ' . ($Label ? $Label : T('Warning.GiveWarning', 'Give Warning')), 'Url' => '/user/Warning/' . intval($UserID), 'CssClass' => 'Popup', 'Class' => 'Popup');
     }
 }
開發者ID:Nordic-T,項目名稱:Nordic-T,代碼行數:6,代碼來源:default.php

示例12: ProfileController_BeforeProfileOptions_Handler

 /**
  * Add "Ignore" option to profile options.
  */
 public function ProfileController_BeforeProfileOptions_Handler($Sender, $Args)
 {
     if (!$Sender->EditMode && Gdn::Session()->IsValid()) {
         // Only show option if allowed
         $IgnoreRestricted = $this->IgnoreRestricted($Sender->User->UserID);
         if ($IgnoreRestricted && $IgnoreRestricted != self::IGNORE_LIMIT) {
             return;
         }
         // Add to dropdown
         $UserIgnored = $this->Ignored($Sender->User->UserID);
         $Label = $UserIgnored ? Sprite('SpUnignore') . ' ' . T('Unignore') : Sprite('SpIgnore') . ' ' . T('Ignore');
         $Args['ProfileOptions'][] = array('Text' => $Label, 'Url' => "/user/ignore/toggle/{$Sender->User->UserID}/" . Gdn_Format::Url($Sender->User->Name), 'CssClass' => 'Popup');
     }
 }
開發者ID:SatiricMan,項目名稱:addons,代碼行數:17,代碼來源:class.ignore.plugin.php

示例13: ProfileController_BeforeProfileOptions_Handler

 /**
  * Add "Message" option to profile options.
  */
 public function ProfileController_BeforeProfileOptions_Handler($Sender, $Args)
 {
     if (!$Sender->EditMode && Gdn::Session()->IsValid() && Gdn::Session()->UserID != $Sender->User->UserID) {
         $Sender->EventArguments['MemberOptions'][] = array('Text' => Sprite('SpMessage') . T('Message'), 'Url' => '/messages/add/' . $Sender->User->Name, 'CssClass' => 'MessageUser');
     }
 }
開發者ID:rnovino,項目名稱:Garden,代碼行數:9,代碼來源:class.hooks.php

示例14: Tick

 /**
  * This is the asynchronous callback
  * 
  * This method is triggerd on every page request via a callback AJAX request
  * so that it may execute asychronously and reduce lag for users. It tracks
  * views, handles registration for new installations, and sends stats every 
  * day as needed.
  * 
  * @return void;
  */
 public function Tick()
 {
     // If we're local and not allowed, or just directly disabled, gtfo
     if (!self::CheckIsEnabled()) {
         return;
     }
     if (Gdn::Session()->CheckPermission('Garden.Settings.Manage')) {
         if (Gdn::Get('Garden.Analytics.Notify', FALSE) !== FALSE) {
             $CallMessage = Sprite('Bandaid', 'InformSprite');
             $CallMessage .= sprintf(T("There's a problem with Vanilla Analytics that needs your attention.<br/> Handle it <a href=\"%s\">here &raquo;</a>"), Url('dashboard/statistics'));
             Gdn::Controller()->InformMessage($CallMessage, array('CssClass' => 'HasSprite'));
         }
     }
     // If the config file is not writable, gtfo
     $ConfFile = PATH_CONF . '/config.php';
     if (!is_writable($ConfFile)) {
         return;
     }
     $InstallationID = Gdn::InstallationID();
     // Check if we're registered with the central server already. If not, this request is
     // hijacked and used to perform that task instead of sending stats or recording a tick.
     if (is_null($InstallationID)) {
         $AttemptedRegistration = Gdn::Get('Garden.Analytics.Registering', FALSE);
         // If we last attempted to register less than 60 seconds ago, do nothing. Could still be working.
         if ($AttemptedRegistration !== FALSE && time() - $AttemptedRegistration < 60) {
             return;
         }
         return $this->Register();
     }
     // Store the view, using denormalization if enabled
     $ViewType = 'normal';
     if (preg_match('`discussion/embed`', Gdn::Request()->Post('ResolvedPath', ''))) {
         $ViewType = 'embed';
     }
     $this->AddView($ViewType);
     // Fire an event for plugins to track their own stats.
     // TODO: Make this analyze the path and throw a specific event (this event will change in future versions).
     $this->EventArguments['Path'] = Gdn::Request()->Post('Path');
     $this->FireEvent('Tick');
     // If we get here, the installation is registered and we can decide on whether or not to send stats now.
     $LastSentDate = self::LastSentDate();
     if (empty($LastSentDate) || $LastSentDate < date('Ymd', strtotime('-1 day'))) {
         return $this->Stats();
     }
 }
開發者ID:rnovino,項目名稱:Garden,代碼行數:55,代碼來源:class.statistics.php

示例15: DiscussionsController_AfterDiscussionFilters_Handler

 public function DiscussionsController_AfterDiscussionFilters_Handler($Sender)
 {
     echo '<li class="PopularDiscussions ' . ($Sender->RequestMethod == 'popular' ? ' Active' : '') . '">' . Anchor(Sprite('SpPopularDiscussions') . ' ' . T('Popular'), '/discussions/popular', 'PopularDiscussions') . '</li>';
 }
開發者ID:vanilla,項目名稱:addons,代碼行數:4,代碼來源:class.voting.plugin.php


注:本文中的Sprite函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。