Ejemplo n.º 1
0
 public static function loadByPositionAndPriority($position, $priority)
 {
     $d = new WidgetObject();
     $request = "SELECT widget_name FROM " . CONFIG_DB_PREFIX . $d->tableName() . " WHERE position = " . $position . " AND priority = " . $priority . " AND activate = 1 ORDER BY priority ASC";
     $results = Database::getAll($request);
     $return = array();
     if (is_array($results)) {
         foreach ($results as $v) {
             $n = new WidgetObject();
             $n->load($v->widget_name);
             $return[] = $n;
         }
     }
     return $return;
 }
Ejemplo n.º 2
0
 public static function uninstallWidgetPage($widgetName)
 {
     $widget = new WidgetObject();
     if ($widget->load($widgetName)) {
         if ($widget->uninstall($widget)) {
             header("location: " . Page::url("/admin/view/widget/"));
         } else {
             header("location: " . Page::url("/admin/view/widget/?err=install"));
         }
     } else {
         header("location: " . Page::url("/admin/view/widget/?err=unknown"));
     }
     return;
 }