/** * Updates a particular model. * If update is successful, the browser will be redirected to the 'view' page. * @param integer $id the ID of the model to be updated */ public function actionUpdate($id) { $model = $this->loadModel($id); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (isset($_POST['Screen'])) { $model->attributes = $_POST['Screen']; if ($model->save()) { if (isset($_POST['Blocks'])) { $blocks = $_POST['Blocks']; Window::model()->deleteAllByAttributes(array('screen_id' => $model->id)); foreach ($blocks as $name => $block) { $windowModel = new Window(); $windowParams = explode(",", $block); $window = array('screen_id' => $model->id, 'name' => $name, 'height' => $windowParams[1], 'width' => $windowParams[0], 'top' => $windowParams[3], 'left' => $windowParams[2], 'authorId' => Yii::app()->user->getId()); $windowModel->attributes = $window; $windowModel->save(); } } $this->redirect(array('view', 'id' => $model->id)); } } $windows = Window::model()->findAllByAttributes(array('screen_id' => $model->id)); $this->render('update', array('model' => $model, 'windows' => $windows)); }
public function __construct(Window $parent, $rows = 0, $cols = 0, $y = 0, $x = 0) { $width = 80; $height = 10; $x = ($parent->getMaxX() - $width) / 2; $y = ($parent->getMaxY() - $height) / 2; parent::__construct($parent, $height, $width, $y, $x); }
public function actionAjaxGetChannels() { $pointId = Yii::app()->request->getPost('pointId'); $pointDateStr = date('Y-m-d'); $requestTime = date('H:i:s'); $pointDatetimeStr = $pointDateStr . " 23:59:59"; $pointDateTimestamp = strtotime($pointDateStr); $weekDay = strtolower(date('D', $pointDateTimestamp)); $Playlist = new Playlists(); $pointChannels = Channel::model()->findAll('id_point=:id_point AND window_id IS NOT NULL', array(':id_point' => $pointId)); $resp = array(); foreach ($pointChannels as $pointChannel) { $pointChannelId = $pointChannel->internalId; $windowId = $pointChannel->window_id; if (!is_null($windowId)) { $bg = $Playlist->GetBGContentArr($pointId, $pointChannelId, $pointDatetimeStr, $weekDay); $adv = $Playlist->GetAdvContentArr($pointId, $pointChannelId, $pointDatetimeStr, $weekDay); $blockStructedContent = $Playlist->BuildBlockStructedContent($bg, $adv); $straightTimeContent = $Playlist->ConverBlockStructedToStraightTimeContent($blockStructedContent); $straightTimeContentHisToSecs = $this->ConvertHisToSecsInStraightTime($straightTimeContent, $requestTime); $url = Yii::app()->request->getBaseUrl(true) . '/spool/points/' . $pointId . '/' . $pointChannelId; $straightTimeContentWithURLPath = $this->UpdateContentPathes($straightTimeContentHisToSecs, $url); $window = Window::model()->findByPK($windowId); $widgetToChannel = WidgetToChannel::model()->find("channel_id = :channel_id", array("channel_id" => $pointChannel->id)); $widget = ''; if (count($widgetToChannel) > 0) { $widgetModel = Widget::model()->findByPk($widgetToChannel['widget_id']); $widget = $widgetModel['content']; } $resp[] = array('width' => $window->width, 'height' => $window->height, 'top' => $window->top, 'left' => $window->left, 'content' => $straightTimeContentWithURLPath, 'widget' => $widget); } } echo json_encode($resp); exit; }
public function __construct($rows = 0, $cols = 0, $y = 0, $x = 0) { parent::__construct($rows, $cols, $y, $x); $this->panel = ncurses_new_panel($this->getWindow()); $rows = $this->getMaxY(); $cols = $this->getMaxX(); $this->addText(["R: {$rows}, C:{$cols}", "x:{$x}, y: {$y}"]); }
public function clear() { return $this->window->clear(); }
<?php include "system.php"; include_once '../../system/class/Log.php'; include_once '../class/Window.php'; $log = new Log(); $o = new Window(); $s = new XoopsSecurity($xoopsDB, $tableprefix, $log); $orgctrl = ""; $action = ""; echo <<<EOF <script type="text/javascript"> function IsNumeric(sText) { var ValidChars = "0123456789.-"; var IsNumber=true; var Char; for (i = 0; i < sText.length && IsNumber == true; i++) { Char = sText.charAt(i); if (ValidChars.indexOf(Char) == -1) { IsNumber = false; } } return IsNumber; }
/** * Makes a window that will be in center of the screen * @param Window $parentWindow A window that will be major for new window * @param integer $columns New window columns count * @param integer $row New window rows count * @return Window A new window that centered of parent window */ public static function createCenteredOf(Window $parentWindow, $columns, $rows) { $parentWindow->getSize($max_columns, $max_rows); return new Window($columns, $rows, $max_columns / 2 - $columns / 2, $max_rows / 2 - $rows / 2); }
foreach ($screens as $val) { $dropDown[$val->id] = $val->name; } if (!$model->isNewRecord) { $screenId = $model->screen_id; $selectedItems[$screenId] = array('selected' => 'selected'); } echo $form->dropDownList($model, 'screen_id', $dropDown, array('options' => $selectedItems, 'multiple' => false, 'class' => 'form-control', 'size' => '10')); printf("<div id='windowsList'>"); if (!$model->isNewRecord) { $screenId = $model->screen_id; $screen = Screen::model()->findByPk($screenId); $windows = $screen->windows; foreach ($windows as $window) { $windowId = $window->id; $windowInst = Window::model()->findByPk($windowId); $windowName = $windowInst->name; $channels = $windowInst->netChannels; foreach ($channels as $channel) { if ($channel->net_id == $model->id) { printf("<div class='ChannelsContainer btn-toolbar' data-channelid='%s' role='toolbar' aria-label=''>", $channel['id']); $channelM = NetChannel::model()->findByPk($channel['id']); $pls = $channelM->playlists; printf("<div class='btn-group' role='group' aria-label=''>" . "<button type='button' class='btn btn-default ChannelButt' disabled='disabled'>Screen %s</button>" . "<button type='button' class='AddPlaylistsBut btn btn-info' data-channelid='%s'>" . "<span class='glyphicon glyphicon-plus'></span> Add playlists" . "</button></div>", $windowName, $channel['id']); foreach ($pls as $pl) { echo "<div class='btn-group' role='group' aria-label=''>"; printf("<button type='button' class='PlaylistLinks btn btn-default' " . "data-plid='%s'>%s</button>", $pl['id'], CHtml::link($pl['name'], array('playlists/' . $pl['id']))); printf("<button type='button' class='RemovePlaylist btn btn-danger' " . "data-plidtoremove='%s' " . "data-channelidpltoremove='%s' " . ">x</button>", $pl['id'], $channel['id']); echo "</div>"; } echo "</div>";
<?php include_once "system.php"; include_once XOOPS_ROOT_PATH . '/modules/simantz/class/Window.inc.php'; $window = new Window(); $action = $_REQUEST['action']; $window->updated = date("Y-m-d H:i:s", time()); $window->updatedby = $xoopsUser->getVar("uid"); switch ($action) { case "ajaxfetch": if ($window->fetchWindow($_REQUEST['window_id'])) { $window->returnWindowXML(); } else { echo "<xml><errortext>Cannot retrieve window_id:" . $_REQUEST['window_id'] . "</errortext></xml>"; } break; case "ajaxgetmodulewindows": $window->mid = $_REQUEST['mid']; echo $window->showParentWindowsTree($window->mid); break; case "ajaxdelete": $window->window_id = $_REQUEST['window_id']; if (!$window->deleteWindow($window->window_id)) { echo "Warning! Cannot delete this window due to unknown reason."; } break; case "ajaxsave": //print_r($_POST); $window->window_id = $_POST['window_id']; $window->window_name = $_POST['window_name']; if ($_POST['isactive'] == 'on') {
/** * Constructor * @param Window A window to associate */ public function __construct(Window $window) { $this->window = $window; $this->panelResource = ncurses_new_panel($window->getWindow()); $this->_debug($this->window, $this->panelResource); }
function remove($login) { if (isset($this->logins[$login])) { foreach (Window::Get($this) as $window) { $window->hide($login); } unset($this->logins[$login]); } }
public function add(Window $child) { parent::add($child); }
} public function setWindow($window) { $this->window = $window; } } class Window { use \FW\DI\DI; public $name; public function __construct($name) { } } $car = Car::buildSoftImmutable()->with(Window::build()->with('win1', 'name')); $newWindow = Window::build()->with('win4', 'name'); var_dump($car->window->name); try { $car->window = Window::build()->with('win2', 'name'); // Will throw an error } catch (Exception $e) { var_dump($e->getMessage()); } try { $car->setWindow($newWindow); // Will work in soft mode } catch (Exception $e) { var_dump($e->getMessage()); } var_dump($car->window->name); // Will be win 4
<?php include_once "system.php"; include_once '../class/Window.inc.php'; include "../class/nitobi.xml.php"; include "../class/SelectCtrl.inc.php"; if ($windowsettingautosave) { $autosaveenabledwords = "autosaveenabled=\"true\""; $promptjavascript = ""; } else { $autosaveenabledwords = ""; $promptjavascript = "return confirm(\"Save record?\"))"; } $window = new Window(); $ctrl = new SelectCtrl(); $xoTheme->addStylesheet("{$url}/modules/simantz/include/nitobi/nitobi.grid/nitobi.grid.css"); $xoTheme->addScript("{$url}/modules/simantz/include/nitobi/nitobi.toolkit.js"); $xoTheme->addScript("{$url}/modules/simantz/include/nitobi/nitobi.grid/nitobi.grid.js"); $xoTheme->addScript("{$url}/modules/simantz/include/firefox3_6fix.js"); //$xoopsTpl->assign('xoops_pagetitle', $menuname); echo <<<EOF <script language="javascript" type="text/javascript"> jQuery(document).ready((function (){ nitobi.loadComponent('DataboundGrid'); })); function init(){} function search(){ var grid = nitobi.getGrid("DataboundGrid");
public function __construct($CraftingRepository) { parent::__construct(); $this->WindowAreas = [new CraftingWindowArea($CraftingRepository, self::craftingOutputIndex), new ArmorWindowArea(self::armorIndex), new WindowArea(self::mainIndex, 27, 9, 3), new WindowArea(self::hotbarIndex, 9, 9, 1)]; }
} public function createTrayIcon() { $this->trayIconMenu = new QMenu(); $this->trayIconMenu->addAction($this->minimizeAction); $this->trayIconMenu->addAction($this->restoreAction); /* $this->trayIconMenu->addAction($this->maximizeAction); $this->trayIconMenu->addSeparator(); $this->trayIconMenu->addAction($this->quitAction); */ $this->trayIcon = new QSystemTrayIcon(); $this->trayIcon->setContextMenu($this->trayIconMenu); $icon = new QIcon("./images/bad.png"); $this->trayIcon->setIcon($icon); } } $app = new QApplication($argc, $argv); if (!QSystemTrayIcon::isSystemTrayAvailable()) { die('no tray available'); } /* if not QtGui.QSystemTrayIcon.isSystemTrayAvailable(): QtGui.QMessageBox.critical(None, QtCore.QObject.tr(app, "Systray"), QtCore.QObject.tr(app, "I couldn't detect any system tray on " "this system.")) sys.exit(1) */ $screenshot = new Window(); $screenshot->show(); $app->exec();
public function add(Window $child) { $this->childs[] = $child; $child->setParent($this->getWindow()); $this->setChanged(true); }
/** * Create window * * @param int $rows * @param int $cols * @param int $y * @param int $x * @return Window */ public function __construct($rows = 0, $cols = 0, $y = 0, $x = 0) { ncurses_init(); parent::__construct($rows = 0, $cols = 0, $y = 0, $x = 0); }
public function saveWindow() { $this->log->showLog(2, "Access saveWindow"); global $xoopsDB, $saveHandler, $createdby, $timestamp; $tablename = "sim_window"; $insertCount = $saveHandler->ReturnInsertCount(); $this->log->showLog(3, "Start Insert({$insertCount} records)"); if ($insertCount > 0) { $arrfield = array("window_name", "mid", "parentwindows_id", "description", "windowsetting", "filename", "isactive", "seqno", "created", "createdby", "updated", "updatedby"); $arrfieldtype = array('%s', '%d', '%d', '%s', '%s', '%s', '%d', '%d', '%s', '%d', '%s', '%d'); // Yes there are INSERTs to perform... for ($currentRecord = 0; $currentRecord < $insertCount; $currentRecord++) { $arrvalue = array($saveHandler->ReturnInsertField($currentRecord, "window_name"), $saveHandler->ReturnInsertField($currentRecord, "mid"), $saveHandler->ReturnInsertField($currentRecord, "parentwindows_id"), $saveHandler->ReturnInsertField($currentRecord, "description"), $saveHandler->ReturnInsertField($currentRecord, "windowsetting"), $saveHandler->ReturnInsertField($currentRecord, "filename"), $saveHandler->ReturnInsertField($currentRecord, "isactive"), $saveHandler->ReturnInsertField($currentRecord, "seqno"), $timestamp, $createdby, $timestamp, $createdby); $controlvalue = $saveHandler->ReturnInsertField($currentRecord, "window_name"); $this->InsertRecord($tablename, $arrfield, $arrvalue, $arrfieldtype, $controlvalue, "window_id"); // Now we execute this query } } $updateCount = $saveHandler->ReturnUpdateCount(); $this->log->showLog(3, "Start update({$updateCount} records)"); if ($updateCount > 0) { $arrfield = array("window_name", "mid", "parentwindows_id", "description", "windowsetting", "filename", "isactive", "seqno", "updated", "updatedby", "isdeleted"); $arrfieldtype = array('%s', '%d', '%d', '%s', '%s', '%s', '%d', '%d', '%s', '%d', '%d'); // Yes there are UPDATEs to perform... for ($currentRecord = 0; $currentRecord < $updateCount; $currentRecord++) { $arrvalue = array($saveHandler->ReturnUpdateField($currentRecord, "window_name"), $saveHandler->ReturnUpdateField($currentRecord, "mid"), $saveHandler->ReturnUpdateField($currentRecord, "parentwindows_id"), $saveHandler->ReturnUpdateField($currentRecord, "description"), $saveHandler->ReturnUpdateField($currentRecord, "windowsetting"), $saveHandler->ReturnUpdateField($currentRecord, "filename"), $saveHandler->ReturnUpdateField($currentRecord, "isactive"), $saveHandler->ReturnUpdateField($currentRecord, "seqno"), $timestamp, $createdby, $saveHandler->ReturnUpdateField($currentRecord, "isdeleted")); $controlvalue = $saveHandler->ReturnUpdateField($currentRecord, "window_name"); $this->UpdateRecord($tablename, "window_id", $saveHandler->ReturnUpdateField($currentRecord), $arrfield, $arrvalue, $arrfieldtype, $controlvalue); } } $ispurge = 0; $deleteCount = $saveHandler->ReturnDeleteCount(); $this->log->showLog(3, "Start delete/purge({$deleteCount} records)"); include "../class/Window.inc.php"; $window = new Window(); if ($deleteCount > 0) { for ($currentRecord = 0; $currentRecord < $deleteCount; $currentRecord++) { $record_id = $saveHandler->ReturnDeleteField($currentRecord); $window->fetchWindow($record_id); $controlvalue = $window->window_name; $isdeleted = $window->isdeleted; $this->DeleteRecord("sim_window", "window_id", $record_id, $controlvalue, $isdeleted); } } //$this->failfeedback.="asdasdpasd<br/>\n"; //$this->failfeedback.="123 3443<br/>\n"; //$this->failfeedback.="234 45656523 234<br/>\n"; if ($this->failfeedback != "") { $this->failfeedback .= "Warning!<br/>\n" . $this->failfeedback; } $saveHandler->setErrorMessage($this->failfeedback); $saveHandler->CompleteSave(); }
public function __construct(Window $parent, $rows = 0, $cols = 0, $y = 0, $x = 0) { $this->parent = $parent; parent::__construct($rows, $cols, $y, $x); }
<?php page_begin("Trade Resources"); $wndItemSelect = new Window(); $wndItemSelect->Name = "wndItemSelect"; $wndItemSelect->Title = "Select Items to Trade"; $wndItemSelect->Left = 500; $wndItemSelect->Width = 500; $wndItemSelect->BeginRender(); ?> <input type="text" id="txtSearch" onchange="txtSearch_TextChanged();" placeholder="Type here to search your inventory" style="width: 100%" /> <div class="ButtonGroup ButtonGroupHorizontal"> <?php $items = mmo_get_items_by_user($CurrentUser); foreach ($items as $item) { ?> <a class="ButtonGroupButton" href="#" onclick=""> <img class="ButtonGroupButtonImage" src="/market/items/<?php echo $item->Name; ?> /images/thumbnail.png" /> <span class="ButtonGroupButtonText"><?php echo $item->Title; ?> </span> </a> <?php } ?> </div> <div style="text-align: right;">
public $name; public function __construct($name) { } } $car = Car::buildImmutable()->with(Window::build()->with('win1', 'name')); var_dump($car->window->name); $carMutable = Car::build()->with(Window::build()->with('win2', 'name')); var_dump($carMutable->window->name); $carMutable->window = Window::build()->with('win3', 'name'); // Will work var_dump($carMutable->window->name); $newWindow = Window::build()->with('win4', 'name'); $carMutable->setWindow($newWindow); var_dump($carMutable->window->name); try { echo "Changing public property\n"; $car->window = Window::build(); // Will throw an error } catch (Exception $e) { var_dump($e->getMessage()); } try { echo "Using method\n"; $car->setWindow($newWindow); // Will throw an error } catch (Exception $e) { var_dump($e->getMessage()); } var_dump($car->window->name); // Will still be win1