/**
  * 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);
         }
     }
 }
 /**
  * @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;
 }
 /**
  * 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()) . '&#160;';
     if ($this->convertToOpportunitySetting == LeadsModule::CONVERT_OPPORTUNITY_NOT_REQUIRED) {
         $content .= Zurmo::t('Core', 'or') . '&#160;' . $skipLink;
     }
     $content .= '</div>';
     if ($this->convertToOpportunitySetting == LeadsModule::CONVERT_OPPORTUNITY_NOT_REQUIRED) {
         $content .= '<div id="opportunity-skip-title">';
         if ($this->userCanCreateOpportunity) {
             $content .= $createLink . '&#160;' . Zurmo::t('Core', 'or') . '&#160;';
         }
         $content .= Zurmo::t('LeadsModule', 'Skip OpportunitiesModuleSingularLabel', LabelUtil::getTranslationParamsForAllModules()) . '&#160;';
         $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>';
 }
 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);
 }
 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;
 }
 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;
 }
 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);
 }
 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'));
     }
 }
 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);
 }
 /**
  * @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;
 }
 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;
 }
 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;
 }
 /**
  * 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;
 }
 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;
 }
 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;
 }
 protected function renderContent()
 {
     $nextPageUrl = Yii::app()->createUrl($this->moduleId . '/' . $this->controllerId . '/checkSystem/');
     $content = '<div class="MetadataView">';
     $content .= '<table><tr><td>';
     $content .= Zurmo::t('InstallModule', 'Welcome to Zurmo. Before getting started, we need some information ' . 'on the database. You will need to know the following items before proceeding:');
     $content .= '<br/>';
     $content .= '<br/>';
     $content .= '<ul>';
     $content .= '<li>' . Zurmo::t('InstallModule', 'Database host') . '</li>';
     $content .= '<li>' . Zurmo::t('InstallModule', 'Database admin username') . '</li>';
     $content .= '<li>' . Zurmo::t('InstallModule', 'Database admin password') . '</li>';
     $content .= '<li>' . Zurmo::t('InstallModule', 'Database name') . '</li>';
     $content .= '<li>' . Zurmo::t('InstallModule', 'Database username') . '</li>';
     $content .= '<li>' . Zurmo::t('InstallModule', 'Database password') . '</li>';
     $content .= '<li>' . Zurmo::t('InstallModule', 'Memcache host') . '</li>';
     $content .= '<li>' . Zurmo::t('InstallModule', 'Memcache port number') . '</li>';
     $content .= '</ul>';
     $content .= Zurmo::t('InstallModule', 'In all likelihood, these items were supplied to you by your Web Host. ' . 'If you do not have this information, then you will need to contact ' . 'them before you can continue. If you\'re all ready...');
     $content .= '<br/><br/>';
     $content .= ZurmoHtml::link(ZurmoHtml::wrapLabel(Zurmo::t('InstallModule', 'Click to start')), $nextPageUrl, array('class' => 'z-button'));
     $content .= '</td></tr></table>';
     $content .= '</div>';
     return $content;
 }
 protected function renderContent()
 {
     $content = $this->renderTitleContent();
     $content .= '<ul class="configuration-list">';
     $modules = Module::getModuleObjects();
     $moduleClassNamesAndLabels = array();
     foreach ($modules as $module) {
         $moduleTreeMenuItems = $module->getDesignerMenuItems();
         if ($module->isEnabled() && !empty($moduleTreeMenuItems)) {
             $moduleClassNamesAndLabels[get_class($module)] = $module::getModuleLabelByTypeAndLanguage('Plural');
         }
     }
     asort($moduleClassNamesAndLabels);
     foreach ($moduleClassNamesAndLabels as $moduleClassName => $label) {
         if (RightsUtil::canUserAccessModule($moduleClassName, Yii::app()->user->userModel)) {
             $route = $this->moduleId . '/' . $this->controllerId . '/modulesMenu/';
             $content .= ZurmoHtml::openTag('li');
             $content .= '<h4>' . $label . '</h4>';
             $content .= ZurmoHtml::link(ZurmoHtml::wrapLabel(Zurmo::t('Core', 'Configure')), Yii::app()->createUrl($route, array('moduleClassName' => $moduleClassName)), array('class' => 'white-button'));
             $content .= ZurmoHtml::closeTag('li');
         }
     }
     $content .= '</ul>';
     return $content;
 }
 public function render()
 {
     if (!empty($this->modelId) && $this->modelId > 0) {
         $htmlOptions = $this->getHtmlOptions();
         $htmlOptions = $this->resolveConfirmAlertInHtmlOptions($htmlOptions);
         return ZurmoHtml::link($this->getLabel(), $this->route, $htmlOptions);
     }
 }
 protected function renderFormLinks()
 {
     $listButton = ZurmoHtml::link(Yii::t('Default', 'Return to List'), Yii::app()->createUrl($this->moduleId));
     $content = '<div id="' . $this->progressBarId . '-links" style="display:none;">';
     $content .= $listButton;
     $content .= '</div>';
     return $content;
 }
 protected function resolvePreviewContainerContent()
 {
     $this->registerPreviewIFrameContainerCloserLinkClick();
     $content = ZurmoHtml::link(ZurmoHtml::tag('span', array('class' => 'z-label'), Zurmo::t('Core', 'Close')), '#', array('id' => BuilderCanvasWizardView::PREVIEW_IFRAME_CONTAINER_CLOSE_LINK_ID, 'class' => 'default-btn'));
     $content .= ZurmoHtml::tag('iframe', $this->resolvePreviewIFrameHtmlOptions(), '');
     $this->wrapContentInDiv($content, $this->resolvePreviewIFrameContainerHtmlOptions());
     return $content;
 }
Exemple #21
0
 /**
  * Formats the value as a hyperlink.
  * @param mixed $value the value to be formatted
  * @return string the formatted result
  */
 public function formatUrl($value, $htmlOptions = array())
 {
     $url = $value;
     if (strpos($url, 'http://') !== 0 && strpos($url, 'https://') !== 0) {
         $url = 'http://' . $url;
     }
     return ZurmoHtml::link(ZurmoHtml::encode($value), $url, $htmlOptions);
 }
 /**
  * @param array $data
  */
 public static function resolveValue($data)
 {
     $userUrl = Yii::app()->createUrl('/users/default/details', array('id' => $data['userId']));
     $user = User::getById($data['userId']);
     $avatarImage = $user->getAvatarImage(24);
     $userLabel = ZurmoHtml::tag('span', array(), $data['userLabel']);
     return ZurmoHtml::link($avatarImage . $userLabel, $userUrl, array('class' => 'user-label'));
 }
 /**
  * Renders string content for the conversation subject and either the description or latest conversation comment
  * if it exists.
  * @param Conversation $conversation
  * @return string
  */
 public static function renderSubjectAndLatestForDisplayView(Conversation $conversation)
 {
     $url = Yii::app()->createUrl('/conversations/default/details', array('id' => $conversation->id));
     $content = $conversation->subject;
     $details = ZurmoHtml::tag('span', array('class' => 'list-item-details'), DateTimeUtil::getTimeSinceDisplayContent($conversation->latestDateTime));
     $link = ZurmoHtml::link($content, $url);
     return $link . $details;
 }
 /**
  * @return string
  */
 public function render()
 {
     if (RightsUtil::canUserAccessModule('ProductTemplatesModule', Yii::app()->user->userModel)) {
         return ZurmoHtml::link($this->resolveLabelAndWrap(), $this->route, $this->getHtmlOptions());
     } else {
         return '';
     }
 }
 protected static function renderTooltipContentForEnableDesktopNotifications()
 {
     $link = ZurmoHtml::link(Zurmo::t('Core', 'Click Here'), '', array('onClick' => 'js:desktopNotifications.requestAutorization(); return false;'));
     $title = Zurmo::t('UsersModule', '<p>This feature only works in Chrome when real time updates are globally enabled. </p>' . '<p>Permissions need to be activated for each browser.</p>' . '<p>To activate, <u>{link}</u> and choose "allow" at browser request.</p>', array('{link}' => $link));
     $content = ZurmoHtml::tag('span', array('id' => 'user-enable-desktop-notifications-tooltip', 'class' => 'tooltip', 'title' => $title), '?');
     $qtip = new ZurmoTip(array('options' => array('position' => array('my' => 'bottom right', 'at' => 'top left'), 'hide' => array('event' => 'unfocus'), 'show' => array('event' => 'click'))));
     $qtip->addQTip("#user-enable-desktop-notifications-tooltip");
     return $content;
 }
 /**
  * @param $model
  * @param $fileModel
  * @return string
  */
 public static function renderDownloadLinkContentByRelationModelAndFileModel($model, $fileModel)
 {
     assert('$model instanceof RedBeanModel');
     assert('$fileModel instanceof FileModel');
     $content = null;
     $content .= '<span class="ui-icon ui-icon-document" style="display:inline-block;"></span>';
     $content .= ZurmoHtml::link(Yii::app()->format->text($fileModel->name), Yii::app()->createUrl('zurmo/fileModel/download/', array('modelId' => $model->id, 'modelClassName' => get_class($model), 'id' => $fileModel->id)));
     return $content;
 }
 /**
  * @return string
  */
 protected function renderPreviousPageLinkContent()
 {
     if ($this->model->isNew()) {
         $label = Zurmo::t('Core', 'Cancel');
     } else {
         $label = Zurmo::t('Core', 'Cancel Changes');
     }
     return ZurmoHtml::link(ZurmoHtml::tag('span', array('class' => 'z-label'), $label), '#', array('id' => static::getPreviousPageLinkId(), 'class' => 'cancel-button'));
 }
 /**
  * @return string
  */
 public function render()
 {
     $kanbanBoardUrl = Yii::app()->createUrl($this->moduleId . '/' . $this->controllerId . '/list/', array('kanbanBoard' => true));
     $listUrl = Yii::app()->createUrl($this->moduleId . '/' . $this->controllerId . '/list/', array('kanbanBoard' => false));
     $content = null;
     $content .= ZurmoHtml::link('<span>Kanban</span>', $kanbanBoardUrl, array('class' => $this->resolveKanbanBoardClass(), 'title' => Zurmo::t('Core', 'View as Kanban Board')));
     $content .= ZurmoHtml::link('<span>Grid</span>', $listUrl, array('class' => $this->resolveGridClass(), 'title' => Zurmo::t('Core', 'View as Grid')));
     return $content;
 }
 protected function renderSelectedLayout()
 {
     $textForLink = ZurmoHtml::tag('span', array('class' => 'z-label'), Zurmo::t('EmailTemplatesModule', 'Select a different layout'));
     $content = $this->resolveThumbnail();
     $content .= ZurmoHtml::tag('h3', array(), $this->model->name);
     $content .= ZurmoHtml::link($textForLink, '#', array('id' => 'chooser-overlay', 'class' => 'secondary-button'));
     $this->wrapContentInDiv($content, $this->getHtmlOptionsForSelectedLayoutDiv());
     return $content;
 }
 public function getLinkString($model)
 {
     $insertLabel = Zurmo::t('ZurmoModule', 'Insert Image');
     if ($this->sourceIdFieldId == null) {
         $url = ImageFileModelUtil::getUrlForGetImageFromImageFileName($model->getImageCacheFileName());
         return ZurmoHtml::link($insertLabel, '#', array('class' => Redactor::LINK_FOR_INSERT_CLASS . ' mini-button', 'data-url' => $url));
     }
     return ZurmoHtml::link($insertLabel, $this->getScriptForClick($model), array('class' => 'mini-button'));
 }