本文整理汇总了PHP中ZurmoHtml::ajaxLink方法的典型用法代码示例。如果您正苦于以下问题:PHP ZurmoHtml::ajaxLink方法的具体用法?PHP ZurmoHtml::ajaxLink怎么用?PHP ZurmoHtml::ajaxLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZurmoHtml
的用法示例。
在下文中一共展示了ZurmoHtml::ajaxLink方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderButton
/**
* Render the link or ajax link
* @param string $id the ID of the button
* @param array $button the button configuration which may contain 'label', 'url', 'imageUrl' and 'options' elements.
* See {@link buttons} for more details.
* @param integer $row the row number (zero-based)
* @param mixed $data the data object associated with the row
*/
protected function renderButton($id, $button, $row, $data)
{
if (isset($button['visible']) && !$this->evaluateExpression($button['visible'], array('row' => $row, 'data' => $data))) {
return;
}
$label = isset($button['label']) ? $button['label'] : $id;
if (isset($button['url'])) {
$url = $this->evaluateExpression($button['url'], array('data' => $data, 'row' => $row));
// Not Coding Standard
} else {
$url = '#';
}
$options = isset($button['options']) ? $button['options'] : array();
if (!isset($options['title'])) {
$options['title'] = $label;
}
if (isset($button['ajaxOptions'])) {
unset($options['ajaxOptions']);
echo ZurmoHtml::ajaxLink($label, $url, $button['ajaxOptions'], $options);
} else {
if (isset($button['imageUrl']) && is_string($button['imageUrl'])) {
echo ZurmoHtml::link(CHtml::image($button['imageUrl'], $label), $url, $options);
} else {
echo ZurmoHtml::link($label, $url, $options);
}
}
}
示例2: renderTestButton
/**
* Render a test button. This link calls a modal
* popup.
* @return The element's content as a string.
*/
protected function renderTestButton()
{
$content = '<span>';
$content .= ZurmoHtml::ajaxLink(ZurmoHtml::wrapLabel(Zurmo::t('EmailMessagesModule', 'Send Test Email')), Yii::app()->createUrl('emailMessages/default/sendTestMessage/', array()), static::resolveAjaxOptionsForTestEmailSettings($this->form->getId()), array('id' => 'SendATestEmailToButton', 'class' => 'EmailTestingButton z-button'));
$content .= '</span>';
return $content;
}
示例3: renderStarredFilterHidenField
protected function renderStarredFilterHidenField($modelClassName, $isFilteredByStarred)
{
$class = $isFilteredByStarred ? 'starred' : 'unstarred';
$url = Yii::app()->controller->createUrl('');
$link = ZurmoHtml::ajaxLink('w', '', array(), array('class' => 'icon-star ' . $class, 'id' => 'starDataColumn_filterByStarred', 'onclick' => $this->getAjaxSubmitScript($modelClassName, $isFilteredByStarred), 'namespace' => 'starDataColumn'));
return $link;
}
示例4: renderTestButton
/**
* Render a test button. This link calls a modal
* popup.
* @return The element's content as a string.
*/
protected function renderTestButton()
{
$content = '<span>';
$content .= ZurmoHtml::ajaxLink(ZurmoHtml::tag('span', array('class' => 'z-label'), Zurmo::t('ZurmoModule', 'Test Connection')), Yii::app()->createUrl('zurmo/ldap/testConnection/', array()), static::resolveAjaxOptionsForTestLdapConnection($this->form->getId()), array('id' => 'TestLdapConnectionButton', 'class' => 'LdapTestingButton z-button'));
$content .= '</span>';
return $content;
}
示例5: renderCreateAccountModalLink
/**
* Render create account modal link
* @return array
*/
private function renderCreateAccountModalLink()
{
$id = $this->getIdForCreateLink();
$label = Zurmo::t('AccountsModule', 'or ');
$label .= $this->getCreateAccountLabel();
$content = ZurmoHtml::ajaxLink($label, Yii::app()->createUrl('accounts/default/modalCreate', $this->getSelectLinkUrlParams()), $this->resolveAjaxOptionsForModalView($id), array('id' => $id, 'style' => $this->getSelectLinkStartingStyle(), 'class' => 'simple-link'));
return $content;
}
示例6: render
public function render()
{
$content = ZurmoHtml::openTag('div', array('class' => 'default-button'));
$label = ZurmoHtml::tag('i', array('class' => $this->params['iconClass']), null);
$label .= ZurmoHtml::tag('span', array('class' => 'button-label'), $this->getLabel());
$content .= $ajaxLink = ZurmoHtml::ajaxLink($label, $this->getDefaultRoute(), $this->getAjaxLinkOptions(), $this->getHtmlOptions());
$content .= ZurmoHtml::closeTag('div');
return $content;
}
示例7: renderHideLinkContent
protected function renderHideLinkContent()
{
$label = '<span></span>' . Zurmo::t('ZurmoModule', 'Dismiss');
$content = '<div class="hide-module-intro">';
$ajaxOptions = array('type' => 'GET', 'success' => "function()\n {\n \$('#{$this->getPanelId()}-checkbox-id').attr('checked', false).parent().removeClass('c_on');\n \$('#{$this->getPanelId()}').slideToggle();\n }\n ");
$content .= ZurmoHtml::ajaxLink($label, Yii::app()->createUrl('zurmo/default/toggleDismissIntroView', array('moduleName' => $this->moduleName, 'panelId' => $this->getPanelId())), $ajaxOptions);
$content .= '</div>';
return $content;
}
示例8: render
public function render()
{
$id = HeaderLinksView::USER_GAME_DASHBOARD_LINK_ID;
$content = ZurmoHtml::openTag('div', array('class' => 'default-button'));
$label = ZurmoHtml::tag('i', array('class' => $this->params['iconClass']), null);
$label .= ZurmoHtml::tag('span', array('class' => 'button-label'), $this->getLabel());
$content .= $ajaxLink = ZurmoHtml::ajaxLink($label, $this->getDefaultRoute(), HeaderLinksView::resolveAjaxOptionsForGameDashboardModel($id), $this->getHtmlOptions());
$content .= ZurmoHtml::closeTag('div');
return $content;
}
示例9: renderTestButton
/**
* Render a test button. This link calls a modal
* popup.
* @return The element's content as a string.
*/
protected function renderTestButton()
{
$id = 'testImapConnection';
$content = '<span>';
$params = array();
$this->resolveParamsFromModel($this->model, $params);
$content .= ZurmoHtml::ajaxLink(ZurmoHtml::wrapLabel(Zurmo::t('ZurmoModule', 'Test Connection')), Yii::app()->createUrl('emailMessages/default/testImapConnection/', $params), static::resolveAjaxOptionsForTestEmailSettings($this->form->getId()), array('id' => $id, 'class' => 'EmailTestingButton z-button'));
$content .= '</span>';
return $content;
}
示例10: renderMenuRecursive
protected function renderMenuRecursive($items)
{
foreach ($items as $item) {
$liClose = null;
$rendered = false;
if (!array_key_exists('renderHeader', $item) || $item['renderHeader']) {
$rendered = true;
$liClose = ZurmoHtml::closeTag('li') . "\n";
$liOptions = array();
if (isset($item['itemOptions'])) {
$liOptions = $item['itemOptions'];
}
echo ZurmoHtml::openTag('li', $liOptions);
if (isset($item['linkOptions'])) {
$htmlOptions = $item['linkOptions'];
} else {
$htmlOptions = array();
}
if (!empty($item['label'])) {
$resolvedLabelContent = $this->renderLabelPrefix() . ZurmoHtml::tag('span', array(), $item['label']);
} else {
$resolvedLabelContent = static::resolveAndGetSpanAndDynamicLabelContent($item);
}
if (isset($item['ajaxLinkOptions'])) {
echo ZurmoHtml::ajaxLink($resolvedLabelContent, $item['url'], $item['ajaxLinkOptions'], $htmlOptions);
} elseif (isset($item['url'])) {
echo ZurmoHtml::link($this->renderLinkPrefix() . $resolvedLabelContent, $item['url'], $htmlOptions);
} else {
if (!empty($item['label'])) {
echo ZurmoHtml::link($resolvedLabelContent, "javascript:void(0);", $htmlOptions);
} else {
echo $resolvedLabelContent;
}
}
}
if (isset($item['items']) && count($item['items'])) {
$nestedUlOpen = null;
$nestedUlClose = null;
if ($rendered) {
$nestedUlOpen = "\n" . ZurmoHtml::openTag('ul', $this->submenuHtmlOptions) . "\n";
$nestedUlClose = ZurmoHtml::closeTag('ul') . "\n";
}
echo $nestedUlOpen;
$this->renderMenuRecursive($item['items']);
echo $nestedUlClose;
}
echo $liClose;
}
}
示例11: renderSelectLink
protected function renderSelectLink()
{
if (!$this->shouldRenderSelectLink) {
return null;
}
$cs = Yii::app()->getClientScript();
$cs->registerCoreScript('bbq');
$cs->registerScriptFile(Yii::app()->getAssetManager()->publish(Yii::getPathOfAlias('application.core.elements.assets')) . '/Modal.js', CClientScript::POS_END);
$this->registerSelectLinkScripts();
$content = ZurmoHtml::openTag('div', array('class' => 'has-model-select'));
$content .= ZurmoHtml::hiddenField($this->getIdForHiddenSelectLinkField());
$content .= ZurmoHtml::ajaxLink('<span class="model-select-icon"></span>', Yii::app()->createUrl($this->getSourceUrlForSelectLink(), $this->getSelectLinkUrlParams()), $this->resolveAjaxOptionsForSelectingModel(), array('id' => $this->getWidgetId() . '-select-link'));
$content .= ZurmoHtml::closeTag('div');
return $content;
}
示例12: renderControlNonEditable
protected function renderControlNonEditable()
{
$avatarImage = $this->model->getAvatarImage(110);
$content = '<div class="gravatar-container">';
if (Yii::app()->user->userModel->id == $this->model->id || RightsUtil::canUserAccessModule('UsersModule', Yii::app()->user->userModel)) {
$span = ZurmoHtml::tag('span', array('id' => 'profile-picture-tooltip'), Zurmo::t('UsersModule', 'Change Profile Picture'), true);
$url = Yii::app()->createUrl('/users/default/changeAvatar', array('id' => $this->model->id));
$modalTitle = ModalView::getAjaxOptionsForModalLink(Zurmo::t('UsersModule', 'Change Profile Picture') . ": " . strval($this->model));
$content .= ZurmoHtml::ajaxLink($span . $avatarImage, $url, $modalTitle);
} else {
$content .= $avatarImage;
}
$content .= '</div>';
return $content;
}
示例13: renderAjaxLink
protected static function renderAjaxLink($id, $label, $url, $pageVar, $page, $style)
{
assert('is_string($id)');
assert('is_string($label)');
assert('is_string($url)');
assert('is_string($pageVar)');
assert('is_int($page)');
assert('is_string($style) || $style == null');
$urlScript = 'js:$.param.querystring("' . $url . '", "' . $pageVar . '=" + $(this).attr("href"))';
// Begin Not Coding Standard
return ZurmoHtml::ajaxLink($label, $urlScript, array('type' => 'GET', 'dataType' => 'json', 'success' => 'js:function(data){
$.each(data, function(key, value){
$("#" + key).html(value);
});
}'), array('id' => $id, 'href' => $page, 'style' => $style, 'class' => 'z-link'));
// End Not Coding Standard
}
示例14: 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
}
示例15: getToggleStarStatusLink
public static function getToggleStarStatusLink($data, $row)
{
$starredClass = 'icon-star unstarred';
$text = 'w';
//w = Star in Icon-Font
if (static::isModelStarred($data)) {
$starredClass = 'icon-star starred';
}
$starId = 'star-' . get_class($data) . '-' . $data->id;
$link = ZurmoHtml::ajaxLink($text, Yii::app()->createUrl('zurmo/default/toggleStar', array('modelClassName' => get_class($data), 'modelId' => $data->id)), array('success' => "function(data){\$('#{$starId}').removeClass().addClass(data)}"), array('class' => $starredClass, 'id' => $starId, 'namespace' => 'update'));
return $link;
}