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


PHP X2Html::link方法代码示例

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


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

示例1: getSortLinks

 public static function getSortLinks($order = null)
 {
     $ret = X2Html::link(Yii::t('topics', 'Sorting'), '#', array('id' => 'topics-sort-toggle', 'class' => 'x2-button', 'style' => 'vertical-align:top;'));
     $links = array(X2Html::link(Yii::t('topics', 'Most Recent'), Yii::app()->controller->createUrl('/topics/topics/index', array('order' => 'mostRecent')), array('class' => 'x2-button' . ($order == 'mostRecent' || is_null($order) ? ' disabled disabled-link' : ''), 'style' => 'vertical-align:top;')), X2Html::link(Yii::t('topics', 'Alphabetical'), Yii::app()->controller->createUrl('/topics/topics/index', array('order' => 'alphabetical')), array('class' => 'x2-button' . ($order == 'alphabetical' ? ' disabled disabled-link' : ''), 'style' => 'vertical-align:top;')), X2Html::link(Yii::t('topics', 'Create Date'), Yii::app()->controller->createUrl('/topics/topics/index', array('order' => 'firstCreated')), array('class' => 'x2-button' . ($order == 'firstCreated' ? ' disabled disabled-link' : ''), 'style' => 'vertical-align:top;')), X2Html::link(Yii::t('topics', 'Most Popular'), Yii::app()->controller->createUrl('/topics/topics/index', array('order' => 'mostPopular')), array('class' => 'x2-button' . ($order == 'mostPopular' ? ' disabled disabled-link' : ''), 'style' => 'vertical-align:top;')));
     $ret .= X2Html::tag('div', array('id' => 'topics-sort-buttons', 'style' => 'display:none;'), implode(' ', $links));
     return $ret;
 }
开发者ID:dsyman2,项目名称:X2CRM,代码行数:7,代码来源:Topics.php

示例2: getLink

 public function getLink()
 {
     if ($this->type === 'folder') {
         return X2Html::link($this->name, '#', array('class' => 'folder-link pseudo-link', 'data-id' => $this->objId));
     } else {
         return X2Html::link($this->name, Yii::app()->controller->createUrl('/docs/view', array('id' => $this->objId)));
     }
 }
开发者ID:dsyman2,项目名称:X2CRM,代码行数:8,代码来源:FileSystemObject.php

示例3: renderButtons

 public function renderButtons()
 {
     $stickyButton = '';
     if (Yii::app()->user->checkAccess('TopicsPinUnpinTopic')) {
         $stickyButton = X2Html::link($this->model->sticky ? Yii::t('topics', 'Unpin Topic') : Yii::t('topics', 'Pin Topic'), '#', array('id' => 'sticky-topic', 'data-id' => $this->model->id, 'class' => 'x2-button', 'style' => 'vertical-align:top;'));
         Yii::app()->clientScript->registerScript('pin-topic', '
             $(document).on("click","#sticky-topic",function(){
                 $.ajax({
                     url:"' . Yii::app()->controller->createUrl('/topics/topics/pinUnpinTopic') . '",
                     data:{id:$(this).attr("data-id")},
                     beforeSend:function(){
                         x2.forms.inputLoading($("#sticky-topic"));
                     },
                     success:function(data){
                         $("#sticky-topic").html(data);
                         x2.forms.inputLoadingStop($("#sticky-topic"));
                     }
                 });
                 return false;
             });
         ', CClientScript::POS_READY);
     }
     echo "<span class='list-view-title-bar-buttons'>\n                {$stickyButton}\n                <div id='show-topics-relationships-button' class='x2-button'>Relationships</div>\n                <div id='show-topics-tags-button' class='x2-button'>Tags</div>\n            </span>";
 }
开发者ID:dsyman2,项目名称:X2CRM,代码行数:24,代码来源:TopicsListView.php

示例4: array

    echo "<div id='inline-relationships-autocomplete-container'>";
    X2Model::renderModelAutocomplete('Contacts');
    echo CHtml::hiddenField('RelationshipModelId');
    echo "</div>";
    echo CHtml::textField('myName', $model->name, array('disabled' => 'disabled'));
    ?>
        <!-- <input type="hidden" id='RelationshipModelId' name="RelationshipModelId"> -->
    </div>

    <div class='row'>
        <?php 
    echo X2Html::label(Yii::t('app', 'Label:'), 'RelationshipLabelButton');
    echo X2Html::textField('secondLabel');
    echo X2Html::textField('firstLabel', '', array('title' => Yii::t('app', 'Create a different label for ') . $model->name));
    echo X2Html::hiddenField('mutual', 'true');
    echo X2Html::link('', '', array('id' => 'RelationshipLabelButton', 'class' => 'pseudo-link fa fa-long-arrow-right', 'title' => Yii::t('app', 'Create a different label for ') . $model->name));
    ?>
    </div>
    
    <?php 
    echo X2Html::csrfToken();
    echo CHtml::button(Yii::t('app', 'Create Relationship'), array('id' => 'add-relationship-button', 'class' => 'x2-button'));
    ?>
    
</form>

<?php 
}
?>

开发者ID:tymiles003,项目名称:X2CRM,代码行数:29,代码来源:_inlineRelationshipsWidget.php

示例5: getImage

 public function getImage($link = false)
 {
     if (!$this->fileExists() || !$this->isImage()) {
         return '';
     }
     if ($this->drive) {
         return $this->googlePreview;
     }
     $img = CHtml::image($this->getPublicUrl(), '', array('class' => 'attachment-img'));
     if (!$link) {
         return $img;
     }
     return X2Html::link($img, $this->getPublicUrl());
 }
开发者ID:xl602,项目名称:X2CRM,代码行数:14,代码来源:Media.php

示例6: getText

 public function getText(array $params = array(), array $htmlOptions = array())
 {
     $truncated = array_key_exists('truncated', $params) ? $params['truncated'] : false;
     $requireAbsoluteUrl = array_key_exists('requireAbsoluteUrl', $params) ? $params['requireAbsoluteUrl'] : false;
     $text = "";
     $authorText = "";
     if (Yii::app()->user->getName() == $this->user) {
         $authorText = CHtml::link(Yii::t('app', 'You'), Yii::app()->controller->createAbsoluteUrl('/profile/view', array('id' => Yii::app()->user->getId())), $htmlOptions);
     } else {
         $authorText = User::getUserLinks($this->user);
     }
     if (!empty($authorText)) {
         $authorText .= " ";
     }
     switch ($this->type) {
         case 'notif':
             $parent = X2Model::model('Notification')->findByPk($this->associationId);
             if (isset($parent)) {
                 $text = $parent->getMessage();
             } else {
                 $text = Yii::t('app', "Notification not found");
             }
             break;
         case 'record_create':
             $actionFlag = false;
             if (class_exists($this->associationType)) {
                 if (count(X2Model::model($this->associationType)->findAllByPk($this->associationId)) > 0) {
                     if ($this->associationType == 'Actions') {
                         $action = X2Model::model('Actions')->findByPk($this->associationId);
                         if (isset($action) && (strcasecmp($action->associationType, 'contacts') === 0 || in_array($action->type, array('call', 'note', 'time')))) {
                             // Special considerations for publisher-created actions, i.e. call,
                             // note, time, and anything associated with a contact
                             $actionFlag = true;
                             // Retrieve the assigned user from the related action
                             $relatedAction = Actions::model()->findByPk($this->associationId);
                             if ($authorText) {
                                 $authorText = User::getUserLinks($relatedAction->assignedTo);
                             }
                         }
                     }
                     if ($actionFlag) {
                         $authorText = empty($authorText) ? Yii::t('app', 'Someone') : $authorText;
                         switch ($action->type) {
                             case 'call':
                                 $text = Yii::t('app', '{authorText} logged a call ({duration}) with {modelLink}: "{logAbbrev}"', array('{authorText}' => $authorText, '{duration}' => empty($action->dueDate) || empty($action->completeDate) ? Yii::t('app', 'duration unknown') : Formatter::formatTimeInterval($action->dueDate, $action->completeDate, '{hoursMinutes}'), '{modelLink}' => X2Model::getModelLink($action->associationId, ucfirst($action->associationType), $requireAbsoluteUrl), '{logAbbrev}' => CHtml::encode($action->actionDescription)));
                                 break;
                             case 'note':
                                 $text = Yii::t('app', '{authorText} posted a comment on {modelLink}: "{noteAbbrev}"', array('{authorText}' => $authorText, '{modelLink}' => X2Model::getModelLink($action->associationId, ucfirst($action->associationType), $requireAbsoluteUrl), '{noteAbbrev}' => CHtml::encode($action->actionDescription)));
                                 break;
                             case 'time':
                                 $text = Yii::t('app', '{authorText} logged {time} on {modelLink}: "{noteAbbrev}"', array('{authorText}' => $authorText, '{time}' => Formatter::formatTimeInterval($action->dueDate, $action->dueDate + $action->timeSpent, '{hoursMinutes}'), '{modelLink}' => X2Model::getModelLink($action->associationId, ucfirst($action->associationType)), '{noteAbbrev}' => CHtml::encode($action->actionDescription)));
                                 break;
                             default:
                                 if (!empty($authorText)) {
                                     $text = Yii::t('app', "A new {actionLink} associated with the contact {contactLink} has been assigned to " . $authorText, array('{actionLink}' => CHtml::link(Events::parseModelName($this->associationType), '#', array_merge($htmlOptions, array('class' => 'action-frame-link', 'data-action-id' => $this->associationId))), '{contactLink}' => X2Model::getModelLink($action->associationId, ucfirst($action->associationType), $requireAbsoluteUrl)));
                                 } else {
                                     $text = Yii::t('app', "A new {actionLink} associated with the contact {contactLink} has been created.", array('{actionLink}' => CHtml::link(Events::parseModelName($this->associationType), '#', array_merge($htmlOptions, array('class' => 'action-frame-link', 'data-action-id' => $this->associationId))), '{contactLink}' => X2Model::getModelLink($action->associationId, ucfirst($action->associationType), $requireAbsoluteUrl)));
                                 }
                         }
                     } else {
                         if (!empty($authorText)) {
                             $modelLink = X2Model::getModelLink($this->associationId, $this->associationType, $requireAbsoluteUrl);
                             if (isset($action) && $this->user !== $action->assignedTo) {
                                 // Include the assignee if this is for an action assigned to someone other than the creator
                                 $translateText = "created a new {modelName} for {assignee}, {modelLink}";
                             } elseif ($modelLink !== '') {
                                 $translateText = "created a new {modelName}, {modelLink}";
                             } else {
                                 $translateText = "created a new {modelName}";
                             }
                             $text = $authorText . Yii::t('app', $translateText, array('{modelName}' => Events::parseModelName($this->associationType), '{modelLink}' => $modelLink, '{assignee}' => isset($action) ? User::getUserLinks($action->assignedTo) : null));
                         } else {
                             $text = Yii::t('app', "A new {modelName}, {modelLink}, has been created.", array('{modelName}' => Events::parseModelName($this->associationType), '{modelLink}' => X2Model::getModelLink($this->associationId, $this->associationType, $requireAbsoluteUrl)));
                         }
                     }
                 } else {
                     $deletionEvent = X2Model::model('Events')->findByAttributes(array('type' => 'record_deleted', 'associationType' => $this->associationType, 'associationId' => $this->associationId));
                     if (isset($deletionEvent)) {
                         if (!empty($authorText)) {
                             $text = $authorText . Yii::t('app', "created a new {modelName}, {deletionText}. It has been deleted.", array('{modelName}' => Events::parseModelName($this->associationType), '{deletionText}' => $deletionEvent->text));
                         } else {
                             $text = Yii::t('app', "A {modelName}, {deletionText}, was created. It has been deleted.", array('{modelName}' => Events::parseModelName($this->associationType), '{deletionText}' => $deletionEvent->text));
                         }
                     } else {
                         if (!empty($authorText)) {
                             $text = $authorText . Yii::t('app', "created a new {modelName}, but it could not be found.", array('{modelName}' => Events::parseModelName($this->associationType)));
                         } else {
                             $text = Yii::t('app', "A {modelName} was created, but it could not be found.", array('{modelName}' => Events::parseModelName($this->associationType)));
                         }
                     }
                 }
             }
             break;
         case 'weblead_create':
             if (count(X2Model::model($this->associationType)->findAllByPk($this->associationId)) > 0) {
                 $text = Yii::t('app', "A new web lead has come in: {modelLink}", array('{modelLink}' => X2Model::getModelLink($this->associationId, $this->associationType)));
             } else {
                 $deletionEvent = X2Model::model('Events')->findByAttributes(array('type' => 'record_deleted', 'associationType' => $this->associationType, 'associationId' => $this->associationId));
                 if (isset($deletionEvent)) {
                     $text = Yii::t('app', "A new web lead has come in: {deletionText}. It has been deleted.", array('{deletionText}' => $deletionEvent->text));
//.........这里部分代码省略.........
开发者ID:shuvro35,项目名称:X2CRM,代码行数:101,代码来源:Events.php

示例7: array

 * technical reasons, the Appropriate Legal Notices must display the words
 * "Powered by X2Engine".
 *****************************************************************************************/
?>

<div id='profile-badge'>
	<span id='profile-avatar'>
	<?php 
echo Profile::renderFullSizeAvatar($this->model->id, 45);
?>
	</span>

	<span id='info'>
	<div id='profile-name'>
		<?php 
echo X2Html::link($this->model->fullName, Yii::app()->controller->createUrl('view', array('id' => $this->model->id, 'publicProfile' => true)));
?>
	</div>

	<!--div id='profile-edit'>
		<!?php echo X2Html::link(
			Yii::t('profile','Edit Profile'),
			Yii::app()->controller->createUrl('update', array(
					'id' => $this->model->id 
				))
			);
		?!>
	</div-->
	</span>
	<div class='clear'></div>
</div>
开发者ID:tymiles003,项目名称:X2CRM,代码行数:31,代码来源:profileInfo.php

示例8: renderSectionHeader

 /**
  * Renders a section header
  * @param  array $section  Section Options
  */
 public function renderSectionHeader($section)
 {
     $html = X2Html::openTag('div', array('class' => 'formSectionHeader'));
     // Add the collapse Icon
     if ($section['collapsible']) {
         $html .= X2Html::link(X2Html::fa('fa-caret-down'), 'javascript:void(0)', array('class' => 'formSectionHide'));
         $html .= X2Html::link(X2Html::fa('fa-caret-right'), 'javascript:void(0)', array('class' => 'formSectionShow'));
     }
     $html .= X2Html::tag('span', array('class' => 'sectionTitle', 'title' => addslashes($section['title'])), Yii::t(strtolower(Yii::app()->controller->id), $section['title']));
     $html .= '</div>';
     return $html;
 }
开发者ID:shuvro35,项目名称:X2CRM,代码行数:16,代码来源:RecordView.php

示例9: array

        <div class="reply-post-number">
            <?php 
echo X2Html::link("#" . ($page * Topics::PAGE_SIZE + ($index + 1)), Yii::app()->controller->createUrl('/topics/topics/view', array('id' => $data->topicId, 'replyId' => $data->id)));
?>
        </div>
        <div class="reply-delete-button">
            <?php 
if ($data->isDeletable()) {
    echo X2Html::ajaxLink(X2Html::fa('close'), Yii::app()->controller->createUrl('/topics/topics/deleteReply', array('id' => $data->id)), array('method' => 'POST', 'data' => array('YII_CSRF_TOKEN' => Yii::app()->request->csrfToken), 'success' => 'function() { window.location = window.location }'), array('class' => 'x2-button right', 'confirm' => Yii::t('topics', 'Are you sure you want to delete this post?')));
}
?>
        </div>
        <div class="reply-edit-button">
            <?php 
if ($data->isEditable()) {
    echo X2Html::link('', Yii::app()->controller->createUrl('/topics/topics/updateReply', array('id' => $data->id)), array('class' => 'x2-button icon edit right'));
}
?>
        </div>
        <div class="clear-fix"></div><br>
    </div>
    <div class="topic-content clear-fix">
        <div class="reply-user-info">
            <div class="reply-username">
                <?php 
echo User::getUserLinks($data->assignedTo);
?>
            </div>
            <div class="img-box user-avatar">
                <?php 
echo Profile::renderFullSizeAvatar($data->getAuthorId(), 45);
开发者ID:tymiles003,项目名称:X2CRM,代码行数:31,代码来源:_viewTopicReply.php


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