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;
305 $data = $this->
getData($format);
306 $fallbackConfigVar = strtolower(preg_replace(
'/([A-Z])/',
'_$1', $format));
308 if (!array_key_exists($supportedLocale, $data)) $data[$supportedLocale] =
Config::getVar(
'general', $fallbackConfigVar);
319 if (is_null($locale)) {
322 $localizedData = $this->
getData(
'dateFormatShort', $locale);
323 if (empty($localizedData)) {
327 return $localizedData;
335 if (is_null($locale)) {
338 $localizedData = $this->
getData(
'dateFormatLong', $locale);
339 if (empty($localizedData)) {
343 return $localizedData;
351 if (is_null($locale)) {
354 $localizedData = $this->
getData(
'timeFormat', $locale);
355 if (empty($localizedData)) {
359 return $localizedData;
367 if (is_null($locale)) {
370 $localizedData = $this->
getData(
'datetimeFormatShort', $locale);
371 if (empty($localizedData)) {
372 $localizedData =
Config::getVar(
'general',
'datetime_format_short');
375 return $localizedData;
383 if (is_null($locale)) {
386 $localizedData = $this->
getData(
'datetimeFormatLong', $locale);
387 if (empty($localizedData)) {
388 $localizedData =
Config::getVar(
'general',
'datetime_format_long');
391 return $localizedData;
405 return $this->
getData($name, $locale);
424 $settingsDao = Application::getContextSettingsDAO();
425 return $settingsDao->updateSetting($this->
getId(), $name, $value, $type, $isLocalized);
449 if (empty($reportPlugins))
return array();
452 $metricTypes = array();
453 foreach ($reportPlugins as $reportPlugin) {
454 $pluginMetricTypes = $reportPlugin->getMetricTypes();
455 if ($withDisplayNames) {
456 foreach ($pluginMetricTypes as $metricType) {
457 $metricTypes[$metricType] = $reportPlugin->getMetricDisplayType($metricType);
460 $metricTypes = array_merge($metricTypes, $pluginMetricTypes);
476 $defaultMetricType = $this->
getData(
'defaultMetricType');
480 if (empty($defaultMetricType)) {
481 if (count($availableMetrics) === 1) {
483 $defaultMetricType = $availableMetrics[0];
487 $defaultMetricType =
$application->getDefaultMetricType();
490 if (!in_array($defaultMetricType, $availableMetrics))
return null;
493 return $defaultMetricType;
511 function getMetrics($metricType =
null, $columns = array(), $filter = array(), $orderBy = array(), $range =
null) {
513 $filter[STATISTICS_DIMENSION_CONTEXT_ID] = $this->
getId();
515 return $application->getMetrics($metricType, $columns, $filter, $orderBy, $range);