當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Box類代碼示例

本文整理匯總了PHP中Box的典型用法代碼示例。如果您正苦於以下問題:PHP Box類的具體用法?PHP Box怎麽用?PHP Box使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Box類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 function __construct($content, $title)
 {
     parent::__construct();
     define(GOOGLE_CODE_TRACKER_NOT_ACTIF, true);
     $this->render = new Table();
     $this->render->setWidth("100%");
     // Header
     if (defined('SITE_META_OPENGRAPH_IMAGE') && SITE_META_OPENGRAPH_IMAGE != "") {
         $logo = new Picture(SITE_META_OPENGRAPH_IMAGE);
     } else {
         $logo = new Picture("img/logo_128x400_" . $_SESSION['lang'] . ".png", 128, 400);
     }
     $logo->setTitle(__(SITE_NAME));
     $logo_link = new Link($this->getPage()->getBaseLanguageURL(), Link::TARGET_NONE, $logo);
     $img_obj = new Object($logo_link);
     $img_obj->add("<br/><br/>");
     $this->render->addRow($img_obj);
     $this->render->addRow();
     // Error message
     $small_img = new Picture("wsp/img/warning_16.png", 16, 16, 0, "absmiddle");
     $title_header = new Object($small_img, $title);
     $error_box = new Box($title_header, true, Box::STYLE_MAIN, Box::STYLE_MAIN, '', 'error_box', 700);
     $error_box->setContent($content);
     $this->render->addRow($error_box);
 }
開發者ID:kxopa,項目名稱:WebSite-PHP,代碼行數:25,代碼來源:error-template.php

示例2: createBox

 /**
  * @param string $dimensions in the format WxHxL ex: 2x3x4
  * @return Box
  */
 public function createBox($dimensions)
 {
     list($width, $height, $length) = explode('x', $dimensions);
     $box = new Box();
     $box->setWidth($width);
     $box->setHeight($height);
     $box->setLength($length);
     return $box;
 }
開發者ID:konrness,項目名稱:wrapping-paper-calculator,代碼行數:13,代碼來源:BoxFactory.php

示例3: price_admin_page

function price_admin_page()
{
    if (isset($_POST['mfdvc'])) {
        $price = json_encode($_POST);
        $box = new Box();
        $box->add_price_option($price);
        see_price();
    } else {
        see_price();
    }
}
開發者ID:Kirbaba,項目名稱:BoxNo.3,代碼行數:11,代碼來源:functions.php

示例4: draw

 function draw()
 {
     global $__utime_start;
     global $__debug_array;
     debug($this, "Execution time (until debugWidget) :" . round(microtime_float() - $__utime_start, 3) . "s");
     $arr =& $__debug_array;
     $out .= "<table class=\"debug\"><tr><td class=\"debug_header\">Object</td><td class=\"debug_header\">Message</td></tr>";
     for ($i = 0; $i < count($arr); $i++) {
         $out .= "<tr><td class=\"debug_object\"><b>" . $arr[$i]["object"] . "</b></td><td class=\"debug_message\">" . $arr[$i]["message"] . "</td></tr>";
     }
     $out .= "</table>";
     $box = new Box("ooCommon NG Debug");
     $box->addWidget(html::write($out));
     return $box->draw();
 }
開發者ID:Esleelkartea,項目名稱:arotz,代碼行數:15,代碼來源:debugwidget.class.php

示例5: boxEdit

 /**
  * Show the member edit page
  *
  * @return string Returns the member edit page as HTML code.
  */
 public function boxEdit()
 {
     if ($Box = Box::get()->byID($this->request->param('ID'))) {
         $GLOBALS['BoxID'] = $Box->ID;
     }
     return $this->customise(new ArrayData(array("Title" => _t('AdminBoxEdit.TITLE', 'AdminBoxEdit.TITLE'), "Form" => $this->BoxEditForm(), "Box" => $Box)))->renderWith(array('BoxAdmin_boxedit', 'BoxAdmin', $this->stat('template_main'), $this->stat('template')));
 }
開發者ID:andrelohmann,項目名稱:vagrant-cloud,代碼行數:12,代碼來源:BoxAdminController.php

示例6: doAdd

 public function doAdd(array $data)
 {
     //print_r($data, true); die();
     if ($Box = Box::get()->byID($data['BoxID'])) {
         $Box->Description = $data['Description'];
         // Update Description
         $Box->write();
         $Version = new BoxVersion();
         $Version->Version = $data['Version'];
         $Version->BoxID = $Box->ID;
         $Version->write();
         $Provider = new BoxProvider();
         $Provider->Name = 'virtualbox';
         $Provider->VersionID = $Version->ID;
         $Provider->ChecksumType = 'sha1';
         $this->saveInto($Provider);
         //$Provider->write();
         $Provider->Checksum = sha1_file($Provider->File()->getFullPath());
         $Provider->write();
     } else {
         $this->sessionMessage(_t('BoxAddVersionForm.INVALIDBOX', 'BoxAddVersionForm.INVALIDBOX'), 'bad');
         return $this->controller->redirectBack();
     }
     $this->controller->redirect('cloud/index');
 }
開發者ID:andrelohmann,項目名稱:vagrant-cloud,代碼行數:25,代碼來源:BoxAddVersionForm.php

示例7: doEdit

 public function doEdit(array $data)
 {
     if ($Box = Box::get()->byID($data['ID'])) {
         $this->saveInto($Box);
         $Box->write();
     }
     $this->controller->redirect('boxadmin/boxes');
 }
開發者ID:andrelohmann,項目名稱:vagrant-cloud,代碼行數:8,代碼來源:BoxEditForm.php

示例8: __construct

 /**
  * Injects the layout/view to the controller.
  *
  * @param \Ilch\Layout\Base $layout
  * @param \Ilch\View        $view
  * @param \Ilch\Request     $request
  * @param \Ilch\Router      $router
  * @param \Ilch\Translator   $translator
  */
 public function __construct(\Ilch\Layout\Base $layout, \Ilch\View $view, \Ilch\Request $request, \Ilch\Router $router, \Ilch\Translator $translator)
 {
     parent::__construct($layout, $view, $request, $router, $translator);
     $this->db = Registry::get('db');
     if (!isset(Box::$staticBoxUniqid)) {
         Box::$staticBoxUniqid = 0;
     } else {
         Box::$staticBoxUniqid++;
     }
     $this->boxUniqid = Box::$staticBoxUniqid;
 }
開發者ID:prepare4battle,項目名稱:Ilch-2.0,代碼行數:20,代碼來源:Box.php

示例9: doAdd

 public function doAdd(array $data)
 {
     if ($Box = Box::get()->filter(array("Title" => $data['Title']))->first()) {
         $this->addErrorMessage('Title', _t('BoxAddForm.TITLEEXISTS', 'BoxAddForm.TITLEEXISTS'), 'bad');
         $this->controller->redirectBack();
         return false;
     }
     $Box = Box::create();
     $this->saveInto($Box);
     $Box->write();
     $this->controller->redirect('boxadmin/boxes');
 }
開發者ID:andrelohmann,項目名稱:vagrant-cloud,代碼行數:12,代碼來源:BoxAddForm.php

示例10: actionCreateFutureDeliveryDatesAndBoxes

 /**
  * Generate new delivery dates and boxes for each date
  */
 public function actionCreateFutureDeliveryDatesAndBoxes()
 {
     $weeksInAdvance = SnapUtil::config('boxomatic/autoCreateDeliveryDates');
     $latestDate = DeliveryDate::getLastEnteredDate();
     if ($latestDate) {
         $latestDate = strtotime($latestDate->date);
     } else {
         $latestDate = time();
     }
     $targetDate = strtotime('+' . $weeksInAdvance . ' weeks');
     $BoxSizes = BoxSize::model()->findAll();
     while ($latestDate <= $targetDate) {
         //			$dateStr = date('j-n-Y',$latestDate);
         //			$parts = explode('-',$dateStr);
         //			mktime(0,0,0,$parts[1],$parts[0],$parts[2]);
         foreach (SnapUtil::config('boxomatic/deliveryDateLocations') as $day => $locationIds) {
             if (!empty($locationIds)) {
                 $latestDate = strtotime('next ' . $day, $latestDate);
                 //var_dump(date('l, d-m-Y',$latestDate));
                 //$latestDateStr=date('Y-m-d',$latestDate);
                 //$latestDate=strtotime($latestDateStr . ' +1 week');
                 $newDateStr = date('Y-m-d', $latestDate);
                 $DeliveryDate = new DeliveryDate();
                 $DeliveryDate->date = $newDateStr;
                 $DeliveryDate->Locations = $locationIds;
                 $DeliveryDate->save();
                 foreach ($BoxSizes as $BoxSize) {
                     $Box = new Box();
                     $Box->size_id = $BoxSize->id;
                     $Box->box_price = $BoxSize->box_size_price;
                     $Box->delivery_date_id = $DeliveryDate->id;
                     $Box->save();
                 }
                 echo '<p>Created new delivery_date: ' . $DeliveryDate->date . '</p>';
             }
         }
     }
     echo '<p><strong>Finished.</strong></p>';
     Yii::app()->end();
 }
開發者ID:snapfrozen,項目名稱:boxomatic,代碼行數:43,代碼來源:CronController.php

示例11: Load

 public function Load()
 {
     parent::$PAGE_TITLE = __(HOME_PAGE_TITLE);
     // Welcome message
     $small_img = new Picture("img/logo_16x16.png", 16, 16, 0, Picture::ALIGN_ABSMIDDLE);
     $title_header = new Object($small_img, __(WELCOME));
     $welcome_box = new Box($title_header, true, Box::STYLE_SECOND, Box::STYLE_SECOND, "", "welcome_box", 600);
     $welcome_obj = new Object(__(WELCOME_MSG));
     list($strAdminLogin, $strAdminPasswd, $strAdminRights) = getWspUserRightsInfo("admin");
     $quickstart_obj = new Object(new Picture("img/quickstart_128.png", 64, 64), "<br/>", __(QUICKSTART));
     $quickstart_link = new Link("http://www.website-php.com/" . $this->getLanguage() . "/quick-start.html", Link::TARGET_BLANK, $quickstart_obj);
     $quickstart_box = new RoundBox(3, "quickstart_box", 120, 120);
     $quickstart_box->setValign(RoundBox::VALIGN_CENTER);
     $quickstart_box->setContent($quickstart_link);
     $tutorial_obj = new Object(new Picture("img/tutorials_128.png", 64, 64), "<br/>", __(TUTORIALS));
     $tutorial_link = new Link("http://www.website-php.com/" . $this->getLanguage() . "/tutorials.html", Link::TARGET_BLANK, $tutorial_obj);
     $tutorial_box = new RoundBox(3, "tutorial_box", 120, 120);
     $tutorial_box->setValign(RoundBox::VALIGN_CENTER);
     $tutorial_box->setContent($tutorial_link);
     $connect_obj = new Object(new Picture("img/wsp-admin/admin_128.png", 64, 64), "<br/>", __(CONNECT));
     $connect_link = new Link("wsp-admin/connect.html", Link::TARGET_BLANK, $connect_obj);
     $connect_box = new RoundBox(3, "connect_box", 120, 120);
     $connect_box->setValign(RoundBox::VALIGN_CENTER);
     $connect_box->setContent($connect_link);
     $icon_table = new Table();
     $icon_table->setDefaultAlign(RowTable::ALIGN_CENTER)->setDefaultValign(RowTable::VALIGN_TOP);
     $icon_row = $icon_table->addRowColumns($quickstart_box, "&nbsp;", $tutorial_box, "&nbsp;", $connect_box);
     $icon_row->setColumnWidth(5, 120);
     if ($strAdminLogin == "admin" && $strAdminPasswd == sha1("admin")) {
         $finalize = new Font(__(FINALIZE_INSTALL));
         $finalize->setFontColor("red");
         $finalize->setFontWeight(Font::FONT_WEIGHT_BOLD);
         $welcome_obj->add("<br/>", $finalize, "<br/>", __(CONNECT_DEFAULT_PASSWD), "<br/>");
     }
     $welcome_obj->add("<br/>", $icon_table);
     $welcome_box->setContent($welcome_obj);
     // Footer
     $this->render = new Template($welcome_box);
 }
開發者ID:kxopa,項目名稱:WebSite-PHP,代碼行數:39,代碼來源:home.php

示例12: loadBoxesFromFile

function loadBoxesFromFile($file)
{
    $handle = fopen($file, 'r');
    $boxes = [];
    if ($handle) {
        while (($line = fgets($handle)) !== false) {
            $boxes[] = Box::createFromString($line);
        }
        if (!feof($handle)) {
            throw new Exception("Error: unexpected fgets() fail\n");
        }
        fclose($handle);
    }
    return $boxes;
}
開發者ID:ryanwinchester,項目名稱:adventofcode,代碼行數:15,代碼來源:functions.php

示例13: duplicate

 /**
  * Duplicate a Box and all its items
  * @return boolean 
  */
 public function duplicate()
 {
     $newBox = new Box();
     $newBox->attributes = $this->attributes;
     $newBox->box_id = null;
     $newBox->save();
     foreach ($this->BoxItems as $BoxItem) {
         $newBoxItem = new BoxItem();
         $newBoxItem->attributes = $BoxItem->attributes;
         $newBoxItem->box_item_id = null;
         $newBoxItem->box_id = $newBox->box_id;
         $newBoxItem->save();
     }
     return true;
 }
開發者ID:snapfrozen,項目名稱:boxomatic,代碼行數:19,代碼來源:Box.php

示例14: fire

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     $dbox = Boxstatus::where('appname', '=', Config::get('jex.tracker_app'))->where('deliveryStatus', '=', Config::get('jayon.trans_status_mobile_delivered'))->get();
     if ($dbox) {
         foreach ($dbox as $dbx) {
             print 'box status : ' . $dbx->deliveryId . ' ' . $dbx->boxId . ' ' . $dbx->deliveryStatus . "\r\n";
             $box = Box::where('delivery_id', '=', $dbx->deliveryId)->where(function ($q) use($dbx) {
                 $q->where('box_id', '=', intval($dbx->boxId))->orWhere('box_id', '=', strval($dbx->boxId));
             })->first();
             if ($box) {
                 print 'box before : ' . $box->delivery_id . ' ' . $box->box_id . ' ' . $box->deliveryStatus . "\r\n";
                 $box->deliveryStatus = $dbx->deliveryStatus;
                 print 'box after : ' . $box->delivery_id . ' ' . $box->box_id . ' ' . $box->deliveryStatus . "\r\n";
                 $box->save();
             }
         }
     }
 }
開發者ID:awidarto,項目名稱:bilnatracker,代碼行數:23,代碼來源:Backtrack.php

示例15: renderItems

 function renderItems($items, $level = 0)
 {
     global $Controller;
     $r = '';
     $r .= '<ol class="' . ($level ? '' : 'list ') . 'bookitems bookitems_' . $level . '">';
     $i = 1;
     foreach ($items as $item) {
         if (!($o = $Controller->{$item['id']}(READ))) {
             continue;
         }
         $r .= '<li class="' . ($i++ % 2 ? 'odd' : 'even') . '">' . '<span class="fixed-width">' . $o->link() . '</span>' . Box::tools($o);
         if (isset($item['children'])) {
             $r .= self::renderItems($item['children'], $level + 1);
         }
         $r .= '</li>';
     }
     $r .= '</ol>';
     return $r;
 }
開發者ID:jonatanolofsson,項目名稱:solidba.se,代碼行數:19,代碼來源:Bookings.php


注:本文中的Box類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。