Example #1
0
 public static function SetupMenu()
 {
     if (uEvents::TriggerEvent('CanAccessModule', __CLASS__) !== FALSE) {
         uAdminBar::AddItem('<a class="btn dashboard-link" href="' . PATH_REL_CORE . '"><span/>Dashboard</a>', FALSE, -100);
     }
 }
Example #2
0
 public static function editPageCallback()
 {
     $thisObj = utopia::GetInstance(__CLASS__);
     if (uEvents::TriggerEvent('CanAccessModule', $thisObj) === FALSE) {
         return;
     }
     if (self::$editCallbackDone) {
         return;
     }
     self::$editCallbackDone = true;
     $rec = uCMS_View::findPage();
     if (!$rec) {
         return;
     }
     if (!isset($_GET['edit'])) {
         $obj = utopia::GetInstance('uCMS_View');
         $editURL = $obj->GetURL(array('cms_id' => $rec['cms_id'], 'edit' => 1));
         uAdminBar::AddItem('<a class="btn" href="' . $editURL . '">Edit Page</a>', FALSE, null, 'edit-page-link');
         return;
     }
     uJavascript::LinkFile(utopia::GetRelativePath(dirname(__FILE__) . '/cms.js'), 9999);
     ob_start();
     $thisObj->ClearFilters();
     $thisObj->AddFilter('cms_id', ctEQ, itNONE, $rec['cms_id']);
     $thisObj->fields['content']['visiblename'] = NULL;
     $thisObj->fields['publishing']['visiblename'] = NULL;
     $thisObj->tabGroup = '_ADMIN_EDIT_';
     $thisObj->ShowData();
     $thisObj->tabGroup = NULL;
     $c = ob_get_clean();
     $pubCell = '<span class="right publish-buttons" style="padding-left:10px">' . $thisObj->GetCell('publishing', $rec) . '</span>';
     $obj = utopia::GetInstance('uCMS_View');
     $url = $obj->GetURL(array('cms_id' => $rec['cms_id']));
     uAdminBar::AddItem('<span class="left">Page Information</span>' . $pubCell, $c);
     uAdminBar::AddItem('<a class="btn" href="' . $url . '">Stop Editing</a>', FALSE, null, 'edit-page-link');
 }