本文整理汇总了PHP中ZurmoHtml::link方法的典型用法代码示例。如果您正苦于以下问题:PHP ZurmoHtml::link方法的具体用法?PHP ZurmoHtml::link怎么用?PHP ZurmoHtml::link使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZurmoHtml
的用法示例。
在下文中一共展示了ZurmoHtml::link方法的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: renderToggleLinkContent
/**
* @return string
*/
public static function renderToggleLinkContent()
{
static::registerSlidingPanelsScript();
$content = ZurmoHtml::tag('span', array(), static::getSlideToSecondPanelLabel());
$content = ZurmoHtml::link($content, '#', array('id' => 'sliding-panel-toggle', 'class' => 'vertical-forward-pager slide-to-second-panel'));
return $content;
}
示例3: renderContent
/**
* Renders content for the view.
* @return A string containing the element's content.
*/
protected function renderContent()
{
Yii::app()->clientScript->registerScript('leadConvertActions', "\n \$('.opportunity-create-link').click( function()\n {\n \$('#OpportunityConvertToView').show();\n \$('#LeadConvertOpportunitySkipView').hide();\n \$('#opportunity-create-title').show();\n \$('#opportunity-skip-title').hide();\n return false;\n }\n );\n \$('.opportunity-skip-link').click( function()\n {\n \$('#OpportunityConvertToView').hide();\n \$('#LeadConvertOpportunitySkipView').show();\n \$('#opportunity-create-title').hide();\n \$('#opportunity-skip-title').show();\n return false;\n }\n );\n ");
$createLink = ZurmoHtml::link(Zurmo::t('OpportunitiesModule', 'Create OpportunitiesModuleSingularLabel', LabelUtil::getTranslationParamsForAllModules()), '#', array('class' => 'opportunity-create-link'));
$skipLink = ZurmoHtml::link(Zurmo::t('LeadsModule', 'Skip OpportunitiesModuleSingularLabel', LabelUtil::getTranslationParamsForAllModules()), '#', array('class' => 'opportunity-skip-link'));
$content = $this->renderTitleContent();
$content .= '<div class="lead-conversion-actions">';
$content .= '<div id="opportunity-create-title">';
$content .= Zurmo::t('OpportunitiesModule', 'Create OpportunitiesModuleSingularLabel', LabelUtil::getTranslationParamsForAllModules()) . ' ';
if ($this->convertToOpportunitySetting == LeadsModule::CONVERT_OPPORTUNITY_NOT_REQUIRED) {
$content .= Zurmo::t('Core', 'or') . ' ' . $skipLink;
}
$content .= '</div>';
if ($this->convertToOpportunitySetting == LeadsModule::CONVERT_OPPORTUNITY_NOT_REQUIRED) {
$content .= '<div id="opportunity-skip-title">';
if ($this->userCanCreateOpportunity) {
$content .= $createLink . ' ' . Zurmo::t('Core', 'or') . ' ';
}
$content .= Zurmo::t('LeadsModule', 'Skip OpportunitiesModuleSingularLabel', LabelUtil::getTranslationParamsForAllModules()) . ' ';
$content .= '</div>';
}
$content .= '</div>';
//this was missing..
$content = $content . ZurmoHtml::tag('div', array('class' => 'left-column full-width clearfix'), parent::renderContent());
return '<div class="wrapper">' . $content . '</div>';
}
示例4: 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);
}
示例5: renderContent
protected function renderContent()
{
$imagePath = Yii::app()->themeManager->baseUrl . '/default/images/ajax-loader.gif';
$progressBarImageContent = ZurmoHtml::image($imagePath, 'Progress Bar');
$cs = Yii::app()->getClientScript();
$cs->registerScriptFile($cs->getCoreScriptUrl() . '/jquery.min.js', CClientScript::POS_END);
$zurmoUpgradeStepTwoUrl = Yii::app()->createUrl($this->moduleId . '/' . $this->controllerId . '/stepTwo/');
$loginUrl = Yii::app()->createUrl('zurmo/default');
$content = '<div class="MetadataView">';
$content .= '<table><tr><td>';
$content .= '<div id="upgrade-step-two" style="display:none;">';
$content .= '<table><tr><td>';
$content .= Zurmo::t('InstallModule', 'The next step is to reload the application and upgrade the schema.');
$content .= '<br/><br/>';
$content .= ZurmoHtml::link(Zurmo::t('InstallModule', 'Click Here to continue with next step'), $zurmoUpgradeStepTwoUrl);
$content .= '</td></tr></table>';
$content .= '</div>';
$content .= '<div id="progress-table">';
$content .= '<table><tr><td class="progress-bar">';
$content .= Zurmo::t('InstallModule', 'Upgrade in progress. Please wait.');
$content .= '<br/>';
$content .= $progressBarImageContent;
$content .= '<br/>';
$content .= '</td></tr></table>';
$content .= '</div>';
$content .= Zurmo::t('InstallModule', 'Upgrade Output:');
$content .= '<div id="logging-table">';
$content .= '</div>';
$content .= '</td></tr></table>';
$content .= '</div>';
return $content;
}
示例6: renderActionBarContent
protected function renderActionBarContent()
{
$currentPageUrl = Yii::app()->createUrl($this->moduleId . '/' . $this->controllerId . '/runDiagnostic/');
$content = '<br/><br/>';
$content .= ZurmoHtml::link(ZurmoHtml::wrapLabel(Zurmo::t('InstallModule', 'Recheck System')), $currentPageUrl, array('class' => 'z-button'));
return $content;
}
示例7: 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');
$handler = "jQuery.yii.submitForm(this, '', {$params}); return false;";
if (isset($htmlOptions['onclick'])) {
$htmlOptions['onclick'] = $htmlOptions['onclick'] . $handler;
} else {
$htmlOptions['onclick'] = $handler;
}
$aContent = ZurmoHtml::tag('span', array('class' => 'z-spinner'), null);
$aContent .= ZurmoHtml::tag('span', array('class' => 'z-icon'), null);
$aContent .= ZurmoHtml::tag('span', array('class' => 'z-label'), $this->getLabel());
return ZurmoHtml::link($aContent, '#', $htmlOptions);
}
示例8: renderGoToDetailsLink
protected function renderGoToDetailsLink()
{
if ($this->haveGoToDetailsLink) {
$link = Yii::app()->createUrl('accounts/default/details/', array('id' => $this->model->id));
return ZurmoHtml::link(Zurmo::t('ZurmoModule', 'Go To Details'), $link, array('class' => 'simple-link', 'target' => '_blank'));
}
}
示例9: renderTabs
protected function renderTabs()
{
$content = ZurmoHtml::link(Zurmo::t('ZurmoModule', 'Library'), '#', array('class' => 'choose-tab active', 'data-view' => 'ImageModalSearchAndListView'));
$content .= ZurmoHtml::link(Zurmo::t('ZurmoModule', 'Upload'), '#', array('class' => 'upload-tab', 'data-view' => 'ImageFilesUploadView'));
$content .= ZurmoHtml::link(Zurmo::t('ZurmoModule', 'Import From Url'), '#', array('class' => 'upload-tab', 'data-view' => 'ImageFilesImportFromUrlView'));
return ZurmoHtml::tag('div', array('class' => 'image-tabs clearfix'), $content);
}
示例10: render
/**
* @return string
*/
public function render()
{
$content = ZurmoHtml::openTag('div', $this->resolveHtmlOptionsForRendering());
$content .= ZurmoHtml::link($this->resolveLabelAndWrap(), '#', array('class' => 'button-action'));
$content .= ZurmoHtml::closeTag('div');
return $content;
}
示例11: renderContent
protected function renderContent()
{
$imagePath = Yii::app()->themeManager->baseUrl . '/default/images/ajax-loader.gif';
$progressBarImageContent = ZurmoHtml::image($imagePath, 'Progress Bar');
$cs = Yii::app()->getClientScript();
$cs->registerScriptFile($cs->getCoreScriptUrl() . '/jquery.min.js', CClientScript::POS_END);
$loginUrl = Yii::app()->createUrl('zurmo/default');
$content = '<div class="MetadataView">';
$content .= '<table><tr><td>';
$content .= '<div id="upgrade-step-two" style="display:none;">';
$content .= '<table><tr><td>';
$content .= Zurmo::t('InstallModule', 'Upgrade process is completed. Please edit perInstance.php file, and disable maintenance mode.');
$content .= '<br/><br/>';
$content .= ZurmoHtml::link(Zurmo::t('InstallModule', 'Click here to access index page, after you disable maintenance mode.'), $loginUrl);
$content .= '</td></tr></table>';
$content .= '</div>';
$content .= '<div id="progress-table">';
$content .= '<table><tr><td class="progress-bar">';
$content .= Zurmo::t('InstallModule', 'Upgrade in progress. Please wait.');
$content .= '<br/>';
$content .= $progressBarImageContent;
$content .= '<br/>';
$content .= '</td></tr></table>';
$content .= '</div>';
$content .= Zurmo::t('InstallModule', 'Upgrade Output:');
$content .= '<div id="logging-table">';
$content .= '</div>';
$content .= '</td></tr></table>';
$content .= '</div>';
return $content;
}
示例12: renderContent
protected function renderContent()
{
$placedViewTypes = Portlet::getPlacedViewTypesByLayoutIdAndUser($this->uniqueLayoutId, Yii::app()->user->userModel->id);
$content = '<ul class="available-portlets">';
$modules = Module::getModuleObjects();
foreach ($modules as $module) {
if ($module->isEnabled()) {
$p = $module->getParentModule();
$viewClassNames = $module::getViewClassNames();
foreach ($viewClassNames as $className) {
$viewReflectionClass = new ReflectionClass($className);
if (!$viewReflectionClass->isAbstract()) {
$portletRules = PortletRulesFactory::createPortletRulesByView($className);
if ($portletRules != null && $portletRules->allowOnDashboard()) {
if ($portletRules->allowMultiplePlacementOnDashboard() && PortletsSecurityUtil::doesCurrentUserHavePermissionToAddPortlet($portletRules) === true || !$portletRules->allowMultiplePlacementOnDashboard() && !in_array($portletRules->getType(), $placedViewTypes) && PortletsSecurityUtil::doesCurrentUserHavePermissionToAddPortlet($portletRules) === true) {
$metadata = $className::getMetadata();
$url = Yii::app()->createUrl($this->moduleId . '/defaultPortlet/add', array('uniqueLayoutId' => $this->uniqueLayoutId, 'dashboardId' => $this->dashboardId, 'portletType' => $portletRules->getType()));
$onClick = 'window.location.href = "' . $url . '"';
$content .= '<li>';
$title = $metadata['perUser']['title'];
MetadataUtil::resolveEvaluateSubString($title);
$label = '<span>\\</span>' . $title;
$content .= ZurmoHtml::link(Zurmo::t('HomeModule', $label), null, array('onclick' => $onClick));
$content .= '</li>';
}
}
}
}
}
}
$content .= '</ul>';
return $content;
}
示例13: renderTitleContent
/**
* Renders title content.
* @return string
*/
protected function renderTitleContent()
{
$title = ZurmoHtml::tag('h3', array(), Zurmo::t('CalendarsModule', 'My Calendars'));
$link = ZurmoHtml::link(ZurmoHtml::tag('span', array('class' => 'z-label'), 'Y'), Yii::app()->createUrl('/calendars/default/create'), array('class' => 'white-button'));
$content = ZurmoHtml::tag('div', array('class' => 'cal-list-header clearfix'), $title . $link);
return $content;
}
示例14: resolveTabbedContent
protected function resolveTabbedContent($plainTextContent, $htmlContent, $activeTab = 'text')
{
$textClass = 'active-tab';
$htmlClass = null;
$htmlTabHyperLink = null;
$htmlContentDiv = null;
if ($activeTab == 'html') {
$textClass = null;
$htmlClass = 'active-tab';
}
$textTabHyperLink = ZurmoHtml::link($this->renderTextContentAreaLabel(), '#tab1', array('class' => $textClass));
$plainTextDiv = ZurmoHtml::tag('div', array('id' => 'tab1', 'class' => $textClass . ' tab email-template-' . static::TEXT_CONTENT_INPUT_NAME), $plainTextContent);
if (isset($htmlContent)) {
$this->registerTabbedContentScripts();
$this->registerRedactorIframeHeightScripts();
$htmlTabHyperLink = ZurmoHtml::link($this->renderHtmlContentAreaLabel(), '#tab2', array('class' => $htmlClass));
$htmlContentDiv = ZurmoHtml::tag('div', array('id' => 'tab2', 'class' => $htmlClass . ' tab email-template-' . static::HTML_CONTENT_INPUT_NAME), $htmlContent);
}
$tagsGuideLink = null;
if ($this->form) {
$controllerId = $this->getControllerId();
$moduleId = $this->getModuleId();
$modelId = $this->model->id;
$tagsGuideLinkElement = new MergeTagGuideAjaxLinkActionElement($controllerId, $moduleId, $modelId);
$tagsGuideLink = $tagsGuideLinkElement->render();
}
$tabContent = ZurmoHtml::tag('div', array('class' => 'tabs-nav'), $textTabHyperLink . $htmlTabHyperLink . $tagsGuideLink);
$content = ZurmoHtml::tag('div', array('class' => 'email-template-content'), $tabContent . $plainTextDiv . $htmlContentDiv);
if ($this->form) {
$content .= $this->renderTextAndHtmlContentAreaError();
}
return $content;
}
示例15: renderContent
protected function renderContent()
{
$imagePath = Yii::app()->themeManager->baseUrl . '/default/images/ajax-loader.gif';
$progressBarImageContent = ZurmoHtml::image($imagePath, 'Progress Bar');
$cs = Yii::app()->getClientScript();
$cs->registerScriptFile($cs->getCoreScriptUrl() . '/jquery.min.js', CClientScript::POS_END);
$loginUrl = Yii::app()->createUrl('zurmo/default');
$content = '<div class="MetadataView">';
$content .= '<table><tr><td>';
$content .= '<div id="complete-table" style="display:none;">';
$content .= '<table><tr><td>';
$content .= Zurmo::t('InstallModule', 'Congratulations! The demo data has been successfully loaded.');
$content .= '<br/>';
$content .= '<br/>';
$content .= Zurmo::t('InstallModule', 'Click below to go to the login page. The username is <b>super</b>');
$content .= '<br/><br/>';
$content .= ZurmoHtml::link(Zurmo::t('ZurmoModule', 'Sign in'), $loginUrl);
$content .= '</td></tr></table>';
$content .= '</div>';
$content .= '<div id="progress-table">';
$content .= '<table><tr><td class="progress-bar">';
$content .= Zurmo::t('InstallModule', 'Loading demo data. Please wait.');
$content .= '<br/>';
$content .= $progressBarImageContent;
$content .= '<br/>';
$content .= '</td></tr></table>';
$content .= '</div>';
$content .= Zurmo::t('InstallModule', 'Installation Output:');
$content .= '<div id="logging-table">';
$content .= '</div>';
$content .= '</td></tr></table>';
$content .= '</div>';
return $content;
}