include/MVC/View/SugarView.php
\SugarView
Base Sugar view
- Children
- \HomeViewAdditionaldetailsretrieve
- \ViewMain
- \ViewModulelabels
- \ViewHome
- \ViewHistory
- \ViewHistory
- \ViewDisplaydeployresult
- \ViewModule
- \ViewExportcustomizations
- \ViewDropdowns
- \ViewRelationship
- \Viewpackage
- \Viewdeletepackage
- \ViewDropdown
- \ViewResetmodule
- \ModuleBuilderViewWizard
- \ViewDisplaydeploy
- \ViewProperty
- \Viewdeletemodule
- \ViewModulefields
- \ViewModulefield
- \ViewRelationships
- \ImportViewStep4
- \ImportView
- \ImportViewError
- \DocumentsViewExtdoc
- \ViewWizard
- \CampaignsViewClassic
- \OauthTokensViewAuthorize
- \ViewAdminsettings
- \CalendarViewSaveSettings
- \CalendarViewJson
- \CalendarViewQuickEdit
- \CalendarViewCreateInvitee
- \CalendarViewGetGR
- \CalendarViewGetGRUsers
- \ConfiguratorViewFontManager
- \ConfiguratorViewSugarpdfsettings
- \ViewAdminwizard
- \ConfiguratorViewAddFontView
- \ConfiguratorViewAddFontResult
- \ViewCampaignconfig
- \ViewConfig
- \ViewConvertLead
- \ViewShowDuplicates
- \ViewModifyProperties
- \ViewModifyMapping
- \ViewConnectorSettings
- \ViewModifyDisplay
- \ViewModifySearch
- \ContactsViewValidPortalUsername
- \ContactsViewContactAddressPopup
- \ContactsViewRetrieveEmail
- \ContactsViewMailMergePopup
- \ViewBackups
- \ViewLanguages
- \ViewConfiguretabs
- \AdministrationViewGlobalsearchsettings
- \ViewConfigureAjaxUI
- \AdministrationViewThemesettings
- \ViewRepair
- \ViewImportvcard
- \ViewMultiedit
- \ViewSugarpdf
- \ViewDetail
- \ViewJson
- \ViewSerialized
- \ViewAjax
- \ViewXML
- \ViewModulelistmenu
- \ViewVcard
- \ViewNoaccess
- \ViewList
- \ViewClassic
- \ViewHtml
- \ViewMetadata
- \ViewPopup
- \ViewEdit
- \ViewFavorites
- \ViewAjaxUI
- \ViewImportvcardsave
- Api
Properties

$errors= 'array()'
Any errors that occured this can either be set by the view or the controller or the model
array()Details- Type
- n/a

$options= 'array('show_header' => true, 'show_title' => true, 'show_subpanels' => false, 'show_search' => true, 'show_footer' => true, 'show_javascript' => true, 'view_print' => false,)'
Options for what UI elements to hide/show/
array('show_header' => true, 'show_title' => true, 'show_subpanels' => false, 'show_search' => true, 'show_footer' => true, 'show_javascript' => true, 'view_print' => false,)Details- Type
- n/a

$ss= 'null'
Sugar_Smarty. This is useful if you have a view and a subview you can share the same smarty object.
nullDetails- Type
- n/a

$suppressDisplayErrors= 'false'
Set to true if you do not want to display errors from SugarView::displayErrors(); instead they will be returned
falseDetails- Type
- n/a
Methods

SugarView(
$bean
=
null, $view_object_map
=
array()
)
:
voidConstructor which will peform the setup.
| Name | Type | Description |
|---|---|---|
| $bean | ||
| $view_object_map |

_getModuleTitleListParam(
bool $browserTitle
=
false
)
:
stringReturns the portion of the array that will represent the listview in the breadcrumb
| Name | Type | Description |
|---|---|---|
| $browserTitle | bool | true if the returned string is being used for the browser title, meaning there should be no HTML in the string |
| Type | Description |
|---|---|
| string |

_getModuleTitleParams(
bool $browserTitle
=
false
)
:
arrayReturns an array composing of the breadcrumbs to use for the module title
| Name | Type | Description |
|---|---|---|
| $browserTitle | bool | true if the returned string is being used for the browser title, meaning there should be no HTML in the string |
| Type | Description |
|---|---|
| array |

_getOption(
string $option, bool $default
=
false
)
:
boolprivate method used in process() to determine the value of a passed in option
| Name | Type | Description |
|---|---|---|
| $option | string | option - the option that we want to know the valye of |
| $default | bool | default - what the default value should be if we do not find the option |
| Type | Description |
|---|---|
| bool | - the value of the option |

checkPostMaxSizeError(
)
:
booleanDetermines whether the state of the post global array indicates there was an error uploading a file that exceeds the post_max_size setting. Such an error can be detected if: 1. The Server['REQUEST_METHOD'] will still point to POST 2. POST and FILES global arrays will be returned empty despite the request method This also results in a redirect to the home page (due to lack of module and action in POST)
| Type | Description |
|---|---|
| boolean | indicating true or false |

display(
)
:
void[OVERRIDE] - This method is meant to overidden in a subclass. This method will handle the actual display logic of the view.

displayHeader(
$retModTabs
=
false
)
:
voidDisplays the header on section of the page; basically everything before the content
| Name | Type | Description |
|---|---|---|
| $retModTabs |

fetchTemplate(
\$file $file
)
:
\$contentfetchTemplate
This function wraps the call to the fetch function of the Smarty variable for the view
| Name | Type | Description |
|---|---|---|
| $file | \$file | String path of the file to fetch |
| Type | Description |
|---|---|
| \$content | String content from resulting Smarty fetch operation on template |

getBreadCrumbSymbol(
)
:
stringReturns the correct breadcrumb symbol according to theme's directionality setting
| Type | Description |
|---|---|
| string |

getBrowserTitle(
)
:
stringReturns the string which will be shown in the browser's title; defaults to using the same breadcrumb as in the module title
| Type | Description |
|---|---|
| string |

getCustomFilePathIfExists(
\$file $file
)
:
\$filegetCustomFilePathIfExists
This function wraps a call to get_custom_file_if_exists from include/utils.php
| Name | Type | Description |
|---|---|---|
| $file | \$file | String of filename to check |
| Type | Description |
|---|---|
| \$file | String of filename including custom directory if found |

getFavicon(
)
:
arrayRetrieves favicon corresponding to currently requested module
| Type | Description |
|---|---|
| array |

getHelpText(
\$module $module
)
:
\$theTitlegetHelpText
This is a protected function that returns the help text portion. It is called from getModuleTitle.
| Name | Type | Description |
|---|---|---|
| $module | \$module | String the formatted module name |
| Type | Description |
|---|---|
| \$theTitle | String the HTML for the help text |

getMenu(
\$module $module
=
null
)
:
arrayLoads the module shortcuts menu
| Name | Type | Description |
|---|---|---|
| $module | \$module | string optional, can specify module to retrieve menu for if not the current one |
| Type | Description |
|---|---|
| array | module menu |

getMetaDataFile(
)
:
stringReturn the metadata file that will be used by this view.
| Type | Description |
|---|---|
| string | File location of the metadata file. |

getModuleTitle(
bool $show_help
=
true
)
:
\HTMLReturn the "breadcrumbs" to display at the top of the page
| Name | Type | Description |
|---|---|---|
| $show_help | bool | optional, true if we show the help links |
| Type | Description |
|---|---|
| \HTML | string containing breadcrumb title |

getSugarConfigJS(
)
:
arrayFetch config values to be put into an array for JavaScript
| Type | Description |
|---|---|
| array |

includeClassicFile(
string $file
)
:
voidIf the view is classic then this method will include the file and setup any global variables.
| Name | Type | Description |
|---|---|---|
| $file | string |

init(
$bean
=
null, $view_object_map
=
array()
)
:
void| Name | Type | Description |
|---|---|---|
| $bean | ||
| $view_object_map |

logMemoryStatistics(
\$newline $newline
=
'
'
)
:
\$messagelogMemoryStatistics
This function returns a string message containing the memory statistics as well as writes to the memory_usage.log file the memory statistics for the SugarView invocation.
| Name | Type | Description |
|---|---|---|
| $newline | \$newline | String of newline character to use (defaults to br>) |
| Type | Description |
|---|---|
| \$message | String formatted message about memory statistics |

preDisplay(
)
:
void[OVERRIDE] - This method is meant to overidden in a subclass. The purpose of this method is to allow a view to do some preprocessing before the display method is called. This becomes useful when you have a view defined at the application level and then within a module have a sub-view that extends from this application level view. The application level view can do the setup in preDisplay() that is common to itself and any subviews and then the subview can just override display(). If it so desires, can also override preDisplay().

prepareConfigVarForJs(
string $key, string $value
)
:
stringUtility method to convert sugar_config values into a JS acceptable format.
| Name | Type | Description |
|---|---|---|
| $key | string | Config Variable Name |
| $value | string | Config Variable Value |
| Type | Description |
|---|---|
| string |