Permalink
Browse files

Namespace fix

  • Loading branch information...
1 parent 52798bb commit 0f01e483c31a70ea6f586c7c37031e15ba29f81a @Stardog Stardog committed Feb 13, 2017
@@ -8,15 +8,15 @@
*/
function update_core_2_3_0()
{
- $db = Database::newDB();
+ $db = \phpws2\Database::newDB();
$dtable = $db->addTable('modules');
if (!$dtable->columnExists('deprecated')) {
$deprecated = $dtable->addDataType('deprecated', 'smallint');
$deprecated->setDefault(1);
$deprecated->add();
}
- $db2 = Database::newDB();
+ $db2 = \phpws2\Database::newDB();
$db2->addTable('mod_settings');
$result = $db2->select();
@@ -364,7 +364,7 @@ public function loadShortcut($title)
public static function shortcut(\Canopy\Key $key)
{
- $modal = new Modal('access-shortcut', null, 'Shortcuts');
+ $modal = new \phpws2\Modal('access-shortcut', null, 'Shortcuts');
$modal->sizeSmall();
$button = '<button class="btn btn-success" id="save-shortcut">Save</button>';
$modal->addButton($button);
@@ -15,7 +15,7 @@ public static function shortcuts()
return;
}
- $modal = new Modal('access-shortcut', null,
+ $modal = new \phpws2\Modal('access-shortcut', null,
'Shortcuts');
$modal->sizeSmall();
$button = '<button class="btn btn-success" id="save-shortcut">Save</button>';
@@ -128,7 +128,7 @@ function block_update(&$content, $currentVersion)
if ($currentVersion == '1.3.6' && PHPWS_Boost::inBranch()) {
moveBlockImages();
}
- $db = Database::newDB();
+ $db = \phpws2\Database::newDB();
$btable = $db->addTable('block');
$dt = $btable->addDataType('hide_narrow', 'smallint');
$dt->add();
@@ -172,7 +172,7 @@ function moveBlockImages()
require_once PHPWS_SOURCE_DIR . 'mod/filecabinet/class/File_Assoc.php';
require_once PHPWS_SOURCE_DIR . 'mod/filecabinet/class/Cabinet.php';
- $db = Database::newDB();
+ $db = \phpws2\Database::newDB();
$block = $db->addTable('block');
$db->setConditional($block->getFieldConditional('file_id', 0, '>'));
$db->loadSelectStatement();
@@ -244,7 +244,7 @@ public static function edit(Block_Item $block, $js = FALSE)
$form->addHidden('key_id', $key_id);
$form->addHidden('action', 'postJSBlock');
- $pdb = Database::newDB();
+ $pdb = \phpws2\Database::newDB();
$pdb->addTable('block_pinned');
$all_pinned = $pdb->select();
@@ -257,7 +257,7 @@ public static function edit(Block_Item $block, $js = FALSE)
}
- $db = Database::newDB();
+ $db = \phpws2\Database::newDB();
$blocks = $db->addTable('block');
$blocks->addField('id');
$blocks->addOrderBy($blocks->addField('title'));
@@ -678,7 +678,7 @@ public function checkConnection()
$dsn = Database::newDSN($this->dbtype, $this->dbuser, $this->dbpass, null, $this->dbhost, $this->dbport);
try {
- $db = Database::newDB($dsn);
+ $db = \phpws2\Database::newDB($dsn);
} catch (\PDOException $e) {
return BRANCH_NO_CONNECTION;
} catch (\Exception $e) {
@@ -1361,7 +1361,7 @@ public function repeatWeekly(Calendar_Event $event)
public static function eventModal($event)
{
$event_form = self::event_form($event);
- $modal = new \Modal('edit-event', $event_form, 'Edit Event');
+ $modal = new \phpws2\Modal('edit-event', $event_form, 'Edit Event');
$modal->setWidthPixel(650);
$modal->addButton('<button class="btn btn-success" id="submit-event">Save</button>');
return $modal->__toString();
@@ -1423,7 +1423,7 @@ public function scheduleListing()
$page_tags['ADD_CALENDAR'] = '<button id="create-schedule" class="btn btn-success"><i class="fa fa-file-text"></i> ' . 'Create schedule' . '</button>';
$schedule_form = $this->calendar->schedule->form();
- $schedule_modal = new \Modal('schedule-modal', $schedule_form, 'Create schedule');
+ $schedule_modal = new \phpws2\Modal('schedule-modal', $schedule_form, 'Create schedule');
$schedule_modal->sizeLarge();
$page_tags['SCHEDULE_FORM'] = $schedule_modal->__toString();
$page_tags['ADMIN_LABEL'] = 'Options';
@@ -147,7 +147,7 @@ function controlpanel_update(&$content, $currentVersion)
case version_compare($currentVersion, '2.3.3', '<'):
case version_compare($currentVersion, '2.3.4', '<'):
$link = new PHPWS_Panel_Link;
- $db = Database::newDB();
+ $db = \phpws2\Database::newDB();
$tbl = $db->addTable('controlpanel_link');
$db->setConditional($tbl->getFieldConditional('itemname',
'controlpanel'));
@@ -30,7 +30,7 @@ public function __construct($folder_id)
protected function loadTemplate()
{
- $modal = new \Modal('edit-file-form');
+ $modal = new \phpws2\Modal('edit-file-form');
$this->template = new \phpws2\Template();
$this->template->setModuleTemplate('filecabinet', 'FC_Forms/folders.html');
$this->template->add('modal', $modal->get());
@@ -13,7 +13,7 @@ class Cabinet_Form
private function getModal()
{
- $modal = new \Modal('folder-form');
+ $modal = new \phpws2\Modal('folder-form');
$modal->setWidthPercentage(30);
$modal->addButton('<button class="btn btn-success save-element">' . _('Save') . '</button>');
return $modal->get();
@@ -224,7 +224,7 @@ function layout_update(&$content, $currentVersion)
EOF;
case version_compare($currentVersion, '2.7.0', '<'):
if (\phpws\PHPWS_Core::moduleExists('block')) {
- $db = Database::newDB();
+ $db = \phpws2\Database::newDB();
$t = $db->addTable('layout_config');
$t->addField('header');
$t->addField('footer');
@@ -289,7 +289,7 @@ public static function arrangeForm()
javascript('jquery');
$script = '<script type="text/javascript" src="' . PHPWS_SOURCE_HTTP . 'mod/layout/javascript/move_boxes.js"></script>';
\Layout::addJSHeader($script, 'moveboxes');
- $modal = new \Modal('box-move', '', 'Move boxes');
+ $modal = new \phpws2\Modal('box-move', '', 'Move boxes');
$modal->sizeLarge();
$template['MODAL'] = $modal->get();
@@ -293,7 +293,7 @@ private function removeFromMenu()
$key_id = $this->page->key_id;
$link = new Menu_Link;
- $db = Database::getDB();
+ $db = \phpws2\Database::getDB();
$t1 = $db->addTable('menu_links');
$t1->addFieldConditional('key_id', $key_id);
$link_result = $db->selectOneRow();
@@ -7,7 +7,7 @@
function pulse_install(&$content)
{
- $db = Database::newDB();
+ $db = \phpws2\Database::newDB();
$db->begin();
try {
@@ -7,7 +7,7 @@
function pulse_uninstall(&$content)
{
$content[] = 'Dropping schedule table.';
- $db = Database::newDB();
+ $db = \phpws2\Database::newDB();
$t1 = $db->addTable('pulse_schedule');
$t1->drop();
return true;
@@ -26,7 +26,7 @@ function pulse_update(&$content, $currentVersion)
return;
}
- $db = Database::newDB();
+ $db = \phpws2\Database::newDB();
$db->begin();
try {
@@ -6,7 +6,7 @@
* @license http://opensource.org/licenses/lgpl-3.0.html
* @author Matthew McNaney <mcnaney at gmail dot com>
*/
-class PulseAdminController extends \Http\Controller
+class PulseAdminController extends \phpws2\Http\Controller
{
public function get(\Canopy\Request $request)
@@ -22,7 +22,7 @@
$tpl = new \phpws2\Template($tpl_vars);
$tpl->setModuleTemplate('qr', 'modal.html');
$content = $tpl->get();
- $modal = new Modal('qr-modal', $content, 'QR Codes (click to download)');
+ $modal = new \phpws2\Modal('qr-modal', $content, 'QR Codes (click to download)');
$modal->sizeLarge();
Layout::add($modal->get());
@@ -393,7 +393,7 @@ public static function import()
$template['DISPLAY_LABEL'] = dgettext('rss', 'Display?');
$template['ACTION_LABEL'] = 'Action';
$template['REFRESH_TIME_LABEL'] = 'Refresh feed';
- $modal = new \Modal('rss-modal');
+ $modal = new \phpws2\Modal('rss-modal');
$modal->addButton('<button class="btn btn-primary" id="save-feed"><i class="fa fa-save"></i> Save</button>');
$modal_content = RSS_Admin::editFeed();
$modal->setContent($modal_content);
@@ -569,7 +569,7 @@ public static function userForm(PHPWS_User $user, $message = NULL)
} else {
$group_ids = $user->getGroups();
if ($group_ids) {
- $db = Database::newDB();
+ $db = \phpws2\Database::newDB();
$t1 = $db->addTable('users_groups');
$f1 = $t1->addField('name');
$c1 = $t1->getFieldConditional('id', $group_ids, 'in');
@@ -355,7 +355,7 @@ public function addConditional(\phpws2\Database\Conditional $conditional)
*
* Example:
* <code>
- * $db = Database::newDB();
+ * $db = \phpws2\Database::newDB();
* $t1 = $db->addTable('alpha');
* $c1 = $t1->getFieldConditional('id', 5);
* $c2 = $t1->getFieldConditional('name', 'Tom');
@@ -33,7 +33,7 @@ protected function __construct()
protected function loadSiteModules()
{
- $db = Database::newDB();
+ $db = \phpws2\Database::newDB();
$mods = $db->addTable('modules');
$mods->addOrderBy($mods->getField('priority'));
$mods->addFieldConditional('active', 1);
@@ -86,7 +86,7 @@ private static function singleton($reload = false)
{
if ($reload || empty(self::$settings)) {
self::$settings = new Settings;
- $db = Database::newDB();
+ $db = \phpws2\Database::newDB();
if (!$db->tableExists('settings')) {
self::createSettingsTable();
}
@@ -237,7 +237,7 @@ public function setCurrentModule($module_name)
public function loadSiteModules()
{
- $db = Database::newDB();
+ $db = \phpws2\Database::newDB();
$mods = $db->addTable('modules');
$mods->addOrderBy($mods->getField('priority'));
$db->loadSelectStatement();

0 comments on commit 0f01e48

Please sign in to comment.