Example #1
0
 /**
  * Specify the language topics to load
  * @return array
  */
 public function getLanguageTopics()
 {
     $topics = array('dashboards', 'user');
     if ($this->widget) {
         $lexicon = $this->widget->get('lexicon');
         if (!empty($lexicon) && $lexicon != 'core:dashboards') {
             $topics[] = $lexicon;
         }
     }
     return $topics;
 }
 /**
  * Render the widget content as if it were a Snippet
  * 
  * @param string $content
  * @return string
  */
 public function renderAsSnippet($content = '')
 {
     if (empty($content)) {
         $content = $this->widget->get('content');
     }
     $content = str_replace(array('<?php', '?>'), '', $content);
     $closure = create_function('$scriptProperties', 'global $modx;if (is_array($scriptProperties)) {extract($scriptProperties, EXTR_SKIP);}' . $content);
     return $closure(array('controller' => $this->controller));
 }