本文整理汇总了PHP中ZurmoHtml类的典型用法代码示例。如果您正苦于以下问题:PHP ZurmoHtml类的具体用法?PHP ZurmoHtml怎么用?PHP ZurmoHtml使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ZurmoHtml类的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: renderAmountContent
/**
* Renders amount
* @return string
*/
protected function renderAmountContent()
{
$model = $this->model;
$amount = Yii::app()->numberFormatter->formatCurrency((double) $model->amount->value, $model->amount->currency->code);
$content = ZurmoHtml::tag('p', array('class' => static::DESCRIPTION_CLASS), Zurmo::t('OpportunitiesModule', 'Amount') . $this->overlayKeyValueSeparator . $amount);
return $content;
}
示例3: renderEditableSecondValueContent
/**
* @return string
*/
protected function renderEditableSecondValueContent()
{
$htmlOptions = $this->getHtmlOptionsForSecondValue();
$inputContent = $this->form->textField($this->model, 'value', $htmlOptions);
$error = $this->form->error($this->model, 'value', array('inputID' => $this->getSecondValueEditableInputId()), true, true, $this->getSecondValueEditableInputId());
return $inputContent . $error . ZurmoHtml::tag('span', array(), ' ' . Zurmo::t('WorkflowsModule', 'value(s)'));
}
示例4: renderThemeContent
/**
* Renders the setting as a radio list.
* @return A string containing the element's content.
*/
protected function renderThemeContent()
{
$gameLevel = GameLevel::resolveByTypeAndPerson(GameLevel::TYPE_GENERAL, Yii::app()->user->userModel);
$content = ZurmoHtml::tag('h3', array(), Zurmo::t('Core', 'Theme'));
$content .= ZurmoHtml::radioButtonList($this->getEditableInputName(KanbanBoard::SELECTED_THEME), $this->model->getKanbanBoard()->getSelectedTheme(), $this->resolveThemeColorNamesAndLabelsForLocking($gameLevel), $this->getEditableThemeHtmlOptions(), array(), $this->resolveDataHtmlOptions($gameLevel));
return $content;
}
示例5: renderControlNonEditable
/**
* Renders the attribute from the model.
* @return The element's content.
*/
protected function renderControlNonEditable()
{
if ($this->model->{$this->attribute} != null) {
$content = DateTimeUtil::convertDbFormattedDateTimeToLocaleFormattedDisplay($this->model->{$this->attribute});
return ZurmoHtml::encode($content);
}
}
示例6: resolveElementDuringFormLayoutRender
/**
* Override to change the editableTemplate to place the label above the input.
* @see DetailsView::resolveElementDuringFormLayoutRender()
*/
protected function resolveElementDuringFormLayoutRender(&$element)
{
if ($element->getAttribute() == 'name') {
$notification = ZurmoHtml::tag('span', array('class' => 'row-description'), Zurmo::t('MarketingListsModule', 'Name will be publicly viewable by Contacts/Leads to manage their subscriptions'));
$element->editableTemplate = '<th>{label}</th><td colspan="{colspan}">{content}' . $notification . '{error}</td>';
}
}
示例7: run
public function run()
{
$id = $this->getId();
$this->htmlOptions['id'] = $id;
if (isset($this->htmlOptions['disabled']) && $this->htmlOptions['disabled'] == 'disabled') {
$tokenListClassSuffix = ' disabled';
} else {
$tokenListClassSuffix = '';
}
echo ZurmoHtml::textField($this->name, null, $this->htmlOptions);
$javaScript = "\$(document).ready(function () { ";
$javaScript .= "\$('#{$id}').tokenInput('{$this->sourceUrl}', { ";
$javaScript .= "queryParam: 'term',";
// Not Coding Standard
if ($this->hintText != null) {
$javaScript .= "hintText: '" . Yii::app()->format->text($this->hintText) . "',";
// Not Coding Standard
}
if ($this->onAdd != null) {
$javaScript .= "onAdd: " . $this->onAdd . ",";
// Not Coding Standard
}
if ($this->onDelete != null) {
$javaScript .= "onDelete: " . $this->onDelete . ",";
// Not Coding Standard
}
if ($this->jsonEncodedIdsAndLabels != null) {
$javaScript .= "prePopulate: " . $this->jsonEncodedIdsAndLabels . ",";
// Not Coding Standard
}
$javaScript .= "preventDuplicates: 'true', classes: {tokenList: 'token-input-list" . $tokenListClassSuffix . "'}";
$javaScript .= "});";
$javaScript .= "});";
Yii::app()->getClientScript()->registerScript(__CLASS__ . '#' . $id, $javaScript);
}
示例8: renderControlEditable
/**
* Render a hidden input, a text input with an auto-complete
* event, and a select button. These three items together
* form the Opportunity Editable Element
* @return The element's content as a string.
*/
protected function renderControlEditable()
{
$content = null;
$content .= ZurmoHtml::textField('stageToProbabilityMapping_notUsed', null, array('id' => $this->getEditableInputId(), 'style' => "display:none;"));
$fieldData = CustomFieldData::getByName('SalesStages');
if ($fieldData->serializedData != null) {
$values = unserialize($fieldData->serializedData);
if (!is_array($values)) {
$values = array();
}
} else {
$values = array();
}
$stagesToProbabilities = OpportunitiesModule::getStageToProbabilityMappingData();
foreach ($values as $value) {
if (isset($stagesToProbabilities[$value])) {
$probability = $stagesToProbabilities[$value];
} else {
$probability = 0;
}
$htmlOptions = array('name' => $this->getNameForInputField($value), 'value' => $probability);
$element = $this->form->textField($this->model, $this->attribute, $htmlOptions);
$element .= ZurmoHtml::tag('span', array(), $value);
$content .= ZurmoHtml::tag('div', array('class' => 'has-lang-label'), $element);
}
return $content;
}
示例9: renderContent
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;
}
示例10: 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);
}
示例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);
$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;
}
示例12: 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);
}
示例13: resolveLabelAndWrap
protected function resolveLabelAndWrap()
{
if ($this->wrapLabel()) {
return ZurmoHtml::wrapLabel($this->getLabel(), 'button-label');
}
return $this->getLabel();
}
示例14: renderMergeTagsContent
protected function renderMergeTagsContent()
{
$title = ZurmoHtml::tag('h3', array(), Zurmo::t('Default', 'Merge Tags'));
$view = new MergeTagsView('Campaign', Element::resolveInputIdPrefixIntoString(array(get_class($this->model), 'textContent')), Element::resolveInputIdPrefixIntoString(array(get_class($this->model), 'htmlContent')), false);
$content = $view->render();
return $title . $content;
}
示例15: 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;
}