18 define(
'METADATA_DISABLE', 0);
19 define(
'METADATA_ENABLE',
'enable');
20 define(
'METADATA_REQUEST',
'request');
21 define(
'METADATA_REQUIRE',
'require');
39 $this->
setData(
'name', $name, $locale);
46 return $this->
getData(
'name', $locale);
54 return $this->
getData(
'contactName');
62 $this->
setData(
'contactName', $contactName);
70 return $this->
getData(
'contactEmail');
78 $this->
setData(
'contactEmail', $contactEmail);
87 return $this->
getData(
'description', $locale);
96 $this->
setData(
'description', $description, $locale);
104 return $this->
getData(
'urlPath');
112 $this->
setData(
'urlPath', $path);
120 return $this->
getData(
'enabled');
128 $this->
setData(
'enabled', $enabled);
136 return $this->
getData(
'primaryLocale');
144 $this->
setData(
'primaryLocale', $primaryLocale);
159 $this->
setData(
'seq', $sequence);
184 return $this->
getData(
'acronym', $locale);
192 $faviconArray = $this->
getData(
'favicon');
194 if (isset($faviconArray[$locale]))
return $faviconArray[$locale];
204 return $this->
getData(
'supportedFormLocales');
213 $supportedLocales =& $this->
getData(
'supportedFormLocaleNames');
215 if (!isset($supportedLocales)) {
216 $supportedLocales = array();
220 if (!isset($locales) || !is_array($locales)) {
224 foreach ($locales as $localeKey) {
225 $supportedLocales[$localeKey] = $localeNames[$localeKey];
229 return $supportedLocales;
237 return $this->
getData(
'supportedSubmissionLocales');
247 $supportedLocales =& $this->
getData(
'supportedSubmissionLocaleNames');
249 if (!isset($supportedLocales)) {
250 $supportedLocales = array();
254 if (!isset($locales) || !is_array($locales)) {
258 foreach ($locales as $localeKey) {
259 $supportedLocales[$localeKey] = $localeNames[$localeKey];
263 return $supportedLocales;
271 return $this->
getData(
'supportedLocales');
280 $supportedLocales =& $this->
getData(
'supportedLocaleNames');
282 if (!isset($supportedLocales)) {
283 $supportedLocales = array();
287 if (!isset($locales) || !is_array($locales)) {
291 foreach ($locales as $localeKey) {
292 $supportedLocales[$localeKey] = $localeNames[$localeKey];
296 return $supportedLocales;
310 return $this->
getData($name, $locale);
329 $settingsDao = Application::getContextSettingsDAO();
330 return $settingsDao->updateSetting($this->
getId(), $name, $value, $type, $isLocalized);
354 if (empty($reportPlugins))
return array();
357 $metricTypes = array();
358 foreach ($reportPlugins as $reportPlugin) {
359 $pluginMetricTypes = $reportPlugin->getMetricTypes();
360 if ($withDisplayNames) {
361 foreach ($pluginMetricTypes as $metricType) {
362 $metricTypes[$metricType] = $reportPlugin->getMetricDisplayType($metricType);
365 $metricTypes = array_merge($metricTypes, $pluginMetricTypes);
381 $defaultMetricType = $this->
getData(
'defaultMetricType');
385 if (empty($defaultMetricType)) {
386 if (count($availableMetrics) === 1) {
388 $defaultMetricType = $availableMetrics[0];
392 $defaultMetricType = $application->getDefaultMetricType();
395 if (!in_array($defaultMetricType, $availableMetrics))
return null;
398 return $defaultMetricType;
416 function getMetrics($metricType =
null, $columns = array(), $filter = array(), $orderBy = array(), $range =
null) {
418 $filter[STATISTICS_DIMENSION_CONTEXT_ID] = $this->
getId();
420 return $application->getMetrics($metricType, $columns, $filter, $orderBy, $range);