Пример #1
0
 /**
  * Retrieve the widget id
  *
  * @param  boolean $autoGenerate automatically generate the id if none is
  *                               already set
  * @return string
  */
 public function getId($autoGenerate = true)
 {
     if (!$this->id && $autoGenerate) {
         $this->id = self::ID_PREFIX . WidgetId::get();
     }
     return $this->id;
 }
 /**
  * Construct ajax call with jquery.
  *
  * @param string $url
  *
  * @return string
  */
 protected function constructJqueryAjaxCall($url)
 {
     $id = WidgetId::get();
     return "var widgetTimer{$id} = setInterval(function() {" . 'if (window.$) {' . "\$('#{$this->getContainerId()}').load('{$url}');" . "clearInterval(widgetTimer{$id});" . '}' . '}, 100);';
 }
 /**
  * Get the current widget container id.
  *
  * @return string
  */
 public function getContainerId()
 {
     return 'arrilot-widget-container-' . WidgetId::get();
 }