当前位置: 首页>>代码示例>>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;未经允许,请勿转载。