本文整理汇总了PHP中ZurmoHtml::wrapLink方法的典型用法代码示例。如果您正苦于以下问题:PHP ZurmoHtml::wrapLink方法的具体用法?PHP ZurmoHtml::wrapLink怎么用?PHP ZurmoHtml::wrapLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZurmoHtml
的用法示例。
在下文中一共展示了ZurmoHtml::wrapLink方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
public function render()
{
$htmlOptions = $this->getHtmlOptions();
$request = Yii::app()->getRequest();
if ($request->enableCsrfValidation && isset($htmlOptions['csrf']) && $htmlOptions['csrf']) {
$htmlOptions['params'][$request->csrfTokenName] = $request->getCsrfToken();
}
if (isset($htmlOptions['params'])) {
$params = CJavaScript::encode($htmlOptions['params']);
unset($htmlOptions['params']);
} else {
$params = '{}';
}
if (isset($htmlOptions['class'])) {
$htmlOptions['class'] .= ' z-button';
} else {
$htmlOptions['class'] = 'z-button';
}
$cs = Yii::app()->getClientScript();
$cs->registerCoreScript('jquery');
$cs->registerCoreScript('yii');
if (Yii::app()->getClientScript()->isIsolationMode()) {
$handler = "jQQ.isolate (function(jQuery, \$)\n {\n jQuery.yii.submitForm(document.getElementById('saveyt1'), '', {$params});\n }); return false;";
} else {
$handler = "jQuery.yii.submitForm(this, '', {$params}); return false;";
}
if (isset($htmlOptions['onclick'])) {
$htmlOptions['onclick'] = $htmlOptions['onclick'] . $handler;
} else {
$htmlOptions['onclick'] = $handler;
}
$aContent = ZurmoHtml::wrapLink($this->getLabel());
return ZurmoHtml::link($aContent, '#', $htmlOptions);
}
示例2: renderRedeemLink
protected static function renderRedeemLink(GameReward $gameReward, $availableCoins)
{
assert('is_int($availableCoins)');
$url = Yii::app()->createUrl('gameRewards/default/redeemReward', array('id' => $gameReward->id));
$label = Zurmo::t('ZurmoModule', 'Redeem');
$aContent = ZurmoHtml::wrapLink($label);
// Begin Not Coding Standard
return ZurmoHtml::ajaxLink($aContent, $url, array('type' => 'GET', 'dataType' => 'json', 'success' => 'function(data){
$("#FlashMessageBar").jnotifyAddMessage({
text: data.message,
permanent: false,
});
$("#GameRewardsRedeemListView").each(function(){
$(this).find(".pager").find(".refresh").find("a").click();
});
}'), self::resolveHtmlOptionsForRedeemLink($gameReward, $availableCoins));
// End Not Coding Standard
}
示例3: renderSaveLayoutButton
protected function renderSaveLayoutButton($notificationBarId)
{
Yii::app()->clientScript->registerScriptFile(Yii::app()->getAssetManager()->publish(Yii::getPathOfAlias('application.core.views.assets')) . '/FormUtils.js', CClientScript::POS_END);
$htmlOptions = array();
$htmlOptions['id'] = 'saveLayout';
$htmlOptions['name'] = 'saveLayout';
$htmlOptions['class'] = 'attachLoading z-button';
$aContent = ZurmoHtml::wrapLink(Zurmo::t('DesignerModule', 'Save Layout'));
return ZurmoHtml::ajaxLink($aContent, '', array('data' => 'js:designer.prepareSaveLayout("edit-form")', 'dataType' => 'json', 'type' => 'POST', 'beforeSend' => 'js:function(){$(this).attachLoadingOnSubmit("edit-form");}', 'complete' => 'js:function(){$(this).detachLoadingOnSubmit("edit-form");}', 'success' => 'function(data){designer.updateFlashBarAfterSaveLayout(data, "' . $notificationBarId . '")}', 'error' => 'function(data){ ' . 'var data = {' . ' "message" : "' . Zurmo::t('Core', 'There was an error processing your request') . '",
"type" : "error"
};
designer.updateFlashBarAfterSaveLayout(data, "' . $notificationBarId . '")
}'), $htmlOptions);
}
示例4: renderAjaxStatusActionChangeLink
/**
* @param int $newStatus
* @param int $missionId
* @param string $label
* @param string $updateDivId
* @return string
*/
protected static function renderAjaxStatusActionChangeLink($newStatus, $missionId, $label, $updateDivId)
{
assert('is_int($newStatus)');
assert('is_int($missionId)');
assert('is_string($label)');
assert('is_string($updateDivId)');
$url = Yii::app()->createUrl('missions/default/ajaxChangeStatus', array('status' => $newStatus, 'id' => $missionId));
$aContent = ZurmoHtml::wrapLink($label);
return ZurmoHtml::ajaxLink($aContent, $url, array('type' => 'GET', 'success' => 'function(data){$("#' . $updateDivId . '").replaceWith(data)}'), array('id' => $newStatus . '-' . $updateDivId, 'class' => 'mission-change-status-link attachLoading z-button ' . self::resolveLinkSpecificCssClassNameByNewStatus($newStatus), 'namespace' => 'update', 'onclick' => 'js:$(this).addClass("loading").addClass("loading-ajax-submit");
$(this).makeOrRemoveLoadingSpinner(true, "#" + $(this).attr("id"));'));
}
示例5: renderSaveLinkContent
/**
* @return string
*/
protected function renderSaveLinkContent()
{
$aContent = ZurmoHtml::wrapLink(Zurmo::t('Core', 'Save'));
return ZurmoHtml::ajaxLink($aContent, $this->getFormActionUrl(), array('type' => 'POST', 'dataType' => 'json', 'data' => 'js:$("#' . static::getFormId() . '").serialize()', 'complete' => 'js:function(){$(this).detachLoadingOnSubmit("' . static::getFormId() . '");}', 'success' => 'function(data)
{
$("#FlashMessageBar").jnotifyAddMessage(
{
text: data.message, permanent: false, showIcon: true, type: data.type
});
}'), array('id' => 'save-order', 'class' => 'attachLoading z-button', 'onclick' => 'js:$(this).addClass("loading").addClass("loading-ajax-submit");
$(this).makeOrRemoveLoadingSpinner(true, "#" + $(this).attr("id"));'));
}
示例6: renderAddExtraColumnContent
/**
* @param int $columnCount
* @return string
*/
protected function renderAddExtraColumnContent($columnCount)
{
assert('is_int($columnCount)');
$idInputHtmlOptions = array('id' => 'columnCounter');
$hiddenInputName = 'columnCounter';
$ajaxOnChangeUrl = Yii::app()->createUrl("import/default/mappingAddExtraMappingRow", array('id' => $this->model->id));
$content = ZurmoHtml::hiddenField($hiddenInputName, $columnCount, $idInputHtmlOptions);
// Begin Not Coding Standard
$aContent = ZurmoHtml::wrapLink(Zurmo::t('ImportModule', 'Add Field'));
$content .= ZurmoHtml::ajaxLink($aContent, $ajaxOnChangeUrl, array('type' => 'GET', 'data' => 'js:\'columnCount=\' + $(\'#columnCounter\').val()', 'complete' => 'js:function(){$("#addExtraColumnButton").removeClass("loading");
$("#addExtraColumnButton").removeClass("loading-ajax-submit");}', 'success' => 'js:function(data){
$(\'#columnCounter\').val(parseInt($(\'#columnCounter\').val()) + 1)
$(\'#addExtraColumnButton\').parent().parent().prev().after(data);
}'), array('id' => 'addExtraColumnButton', 'class' => 'attachLoading z-button', 'onclick' => 'js:if ($(this).hasClass("loading")) {return false;}
$(this).addClass("loading").addClass("loading-ajax-submit");
$(this).makeOrRemoveLoadingSpinner(true, "#" + $(this).attr("id"));'));
// End Not Coding Standard
return $content;
}
示例7: renderSaveModalSettingsButton
protected function renderSaveModalSettingsButton()
{
return ZurmoHtml::link(ZurmoHtml::wrapLink(Zurmo::t('Core', 'Save and Close')), '#', array('class' => 'green-button', 'onclick' => '$(this).closest(".modal-settings").dialog("close");'));
// Not Coding Standard
}
示例8: renderAddExtraRowContent
/**
* @param int $rowCount
* @return string
*/
protected function renderAddExtraRowContent($rowCount)
{
assert('is_int($rowCount)');
$idInputHtmlOptions = array('id' => $this->getRowCounterInputId());
$hiddenInputName = 'rowCounter';
$ajaxOnChangeUrl = Yii::app()->createUrl("zurmo/default/dynamicSearchAddExtraRow", array('viewClassName' => get_class($this), 'modelClassName' => get_class($this->model->getModel()), 'formModelClassName' => get_class($this->model), 'suffix' => $this->getSearchFormId()));
$content = ZurmoHtml::hiddenField($hiddenInputName, $rowCount, $idInputHtmlOptions);
// Begin Not Coding Standard
$addFieldLabelContent = $this->getAddFieldLabelContent();
$aContent = ZurmoHtml::wrapLink($addFieldLabelContent);
$content .= ZurmoHtml::ajaxLink($aContent, $ajaxOnChangeUrl, array('type' => 'GET', 'data' => 'js:\'rowNumber=\' + $(\'#rowCounter-' . $this->getSearchFormId() . '\').val()', 'beforeSend' => 'js:function(){
$(this).makeOrRemoveLoadingSpinner(true, "#' . $this->getSearchFormId() . '", "dark");
}', 'success' => 'js:function(data){
$(\'#' . $this->getRowCounterInputId() . '\').val(parseInt($(\'#' . $this->getRowCounterInputId() . '\').val()) + 1)
$(\'#addExtraAdvancedSearchRowButton-' . $this->getSearchFormId() . '\').parent().before(data);
rebuildDynamicSearchRowNumbersAndStructureInput("' . $this->getSearchFormId() . '");
resolveClearLinkPrefixLabelAndVisibility("' . $this->getSearchFormId() . '");
$(this).makeOrRemoveLoadingSpinner(false, "#' . $this->getSearchFormId() . '");
}'), array('id' => 'addExtraAdvancedSearchRowButton-' . $this->getSearchFormId(), 'namespace' => 'add'));
// End Not Coding Standard
return ZurmoHtml::tag('div', array('class' => 'add-fields-container'), $content);
}
示例9: renderPostToProfileLinkContent
protected static function renderPostToProfileLinkContent(GameNotification $notification, $index)
{
assert('is_int($index)');
$socialItemAdapter = new GameNotificationToSocialItemContentAdapter($notification);
$url = Yii::app()->createUrl('socialItems/default/postGameNotificationToProfile', array('content' => $socialItemAdapter->getMessageContent()));
$aContent = ZurmoHtml::wrapLink(Zurmo::t('ZurmoModule', 'Post to Profile'));
// Begin Not Coding Standard
$content = ZurmoHtml::ajaxLink($aContent, $url, array('type' => 'GET', 'complete' => "function(XMLHttpRequest, textStatus){\n \$('#ModalGameNotification" . $index . "').dialog('close'); return false;}"), array('class' => 'close-ModalGameNotification default-btn', 'onclick' => 'js:$(this).addClass("loading").addClass("loading-ajax-submit");
$(this).makeOrRemoveLoadingSpinner(true, "#" + $(this).attr("id"), "dark");'));
// End Not Coding Standard
return $content;
}
示例10: renderAddEmailMessageLink
/**
* @param string $label
* @return string
*/
protected function renderAddEmailMessageLink($label)
{
assert('is_string($label)');
$rowCounterInputId = static::resolveRowCounterInputId(ComponentForWorkflowForm::TYPE_EMAIL_MESSAGES);
$moduleClassNameId = get_class($this->model) . '[moduleClassName]';
$url = Yii::app()->createUrl('workflows/default/addEmailMessage', array_merge($_GET, array('type' => $this->model->type)));
$aContent = ZurmoHtml::wrapLink($label);
return ZurmoHtml::ajaxLink($aContent, $url, array('type' => 'GET', 'data' => 'js:\'moduleClassName=\' + $("input:radio[name=\\"' . $moduleClassNameId . '\\"]:checked").val() + ' . '\'&rowNumber=\' + $(\'#' . $rowCounterInputId . '\').val()', 'url' => $url, 'beforeSend' => 'js:function()
{ ;
$(".ui-overlay-block").fadeIn(50);
$(this).makeLargeLoadingSpinner(true, ".ui-overlay-block"); //- add spinner to block anything else
}', 'success' => 'js:function(data)
{
$(\'#' . $rowCounterInputId . '\').val(parseInt($(\'#' . $rowCounterInputId . '\').val()) + 1);
$(".droppable-dynamic-rows-container.' . ComponentForWorkflowForm::TYPE_EMAIL_MESSAGES . '").find(".dynamic-rows").find("ul:first").first().append("<li>" + data + "</li>");
rebuildWorkflowEmailMessageRowNumbers("' . get_class($this) . '");
$(".' . static::getZeroComponentsClassName() . '").hide();
$(this).makeLargeLoadingSpinner(false, ".ui-overlay-block");
$(".ui-overlay-block").fadeOut(50);
}'), array('id' => self::ADD_EMAIL_MESSAGE_LINK_ID, 'class' => 'attachLoading z-button '));
}
示例11: renderCompleteButton
protected static function renderCompleteButton($collectionId, $userId, $canCollect = true)
{
assert('is_int($collectionId)');
assert('is_int($userId)');
assert('is_bool($canCollect)');
$url = Yii::app()->createUrl('gamification/default/redeemCollection/', array('id' => $collectionId));
$htmlOptions = array();
$disabledClass = null;
$disabled = false;
if (!$canCollect || $userId != Yii::app()->user->userModel->id) {
$disabledClass = ' disabled';
$disabled = true;
}
$id = static::getCompleteCollectionLinkId($collectionId);
$htmlOptions['id'] = $id;
$htmlOptions['name'] = $id;
$htmlOptions['class'] = 'attachLoading z-button coin-button' . $disabledClass;
if ($disabled) {
$htmlOptions['onclick'] = 'js:return false;';
} else {
$htmlOptions['onclick'] = 'js:$(this).addClass("loading").addClass("loading-ajax-submit");
$(this).makeOrRemoveLoadingSpinner(true, "#" + $(this).attr("id"), "#763d05");';
}
$aContent = ZurmoHtml::wrapLink(Zurmo::t('Core', 'Complete'));
$containerId = static::getCollectionContainerId($collectionId);
return ZurmoHtml::ajaxLink($aContent, $url, array('type' => 'GET', 'success' => 'js:function(data)
{
$("#' . $containerId . '").replaceWith(data);
$("#' . $containerId . '").addClass("visible-panel");
' . self::renderGameCoinRefreshAjax($userId) . '
updateGamificationImagesSrcForLazyLoading();
}'), $htmlOptions);
}
示例12: renderApplyLink
/**
* Render Apply Action Link
* @return string
*/
protected function renderApplyLink()
{
$this->registerApplyClickScript();
$label = $this->renderApplyLinkLabel();
$htmlOptions = $this->resolveApplyLinkHtmlOptions();
$wrappedLabel = ZurmoHtml::wrapLink($label);
$link = ZurmoHtml::link($wrappedLabel, '#', $htmlOptions);
return $link;
}