• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP AssetModel类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中AssetModel的典型用法代码示例。如果您正苦于以下问题:PHP AssetModel类的具体用法?PHP AssetModel怎么用?PHP AssetModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了AssetModel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: lstModel_Create

 protected function lstModel_Create()
 {
     $this->lstModel = new QListBox($this, 'Model');
     $this->lstModel->Name = 'Model';
     $this->lstModel->AddItem('- Select One -', null);
     $assetModelArray = AssetModel::LoadAllIntoArray();
     if ($assetModelArray) {
         foreach ($assetModelArray as $assetModel) {
             $objListItem = new QListItem($assetModel['short_description'], $assetModel['asset_model_id']);
             $this->lstModel->AddItem($objListItem);
         }
     }
     $this->lstModel->Enabled = false;
 }
开发者ID:proxymoron,项目名称:tracmor,代码行数:14,代码来源:AssetMassEditPanel.class.php


示例2: SetupAssetModel

 protected function SetupAssetModel()
 {
     // Lookup Object PK information from Query String (if applicable)
     // Set mode to Edit or New depending on what's found
     $intAssetModelId = QApplication::QueryString('intAssetModelId');
     if ($intAssetModelId) {
         $this->objAssetModel = AssetModel::Load($intAssetModelId);
         if (!$this->objAssetModel) {
             throw new Exception('Could not find a AssetModel object with PK arguments: ' . $intAssetModelId);
         }
         $this->strTitleVerb = QApplication::Translate('Edit');
         $this->blnEditMode = true;
     } else {
         $this->objAssetModel = new AssetModel();
         $this->strTitleVerb = QApplication::Translate('Create');
         $this->blnEditMode = false;
     }
 }
开发者ID:brustj,项目名称:tracmor,代码行数:18,代码来源:AssetModelEditFormBase.class.php


示例3: rblAssetType_Change

 protected function rblAssetType_Change($strFormId, $strControlId, $strParameter)
 {
     $this->txtNewAssetCode->Text = '';
     // If adding an existing asset to the receipt
     if ($this->rblAssetType->SelectedValue == 'existing') {
         $this->lstAssetModel->Display = false;
         $this->chkAutoGenerateAssetCode->Checked = false;
         $this->chkAutoGenerateAssetCode->Display = false;
         $this->txtNewAssetCode->Enabled = true;
         $this->lblAddAsset->Display = true;
     } elseif ($this->rblAssetType->SelectedValue == 'new') {
         $objAssetModelArray = AssetModel::LoadAll(QQ::Clause(QQ::OrderBy(QQN::AssetModel()->ShortDescription)));
         if ($objAssetModelArray) {
             foreach ($objAssetModelArray as $objAssetModel) {
                 $objListItem = new QListItem($objAssetModel->__toString(), $objAssetModel->AssetModelId);
                 $this->lstAssetModel->AddItem($objListItem);
             }
         }
         // Display the list of possible asset models
         $this->lstAssetModel->Display = true;
         // Display the Auto Generate Asset Code checkbox if a minimum value exists
         if (QApplication::$TracmorSettings->MinAssetCode) {
             $this->chkAutoGenerateAssetCode->Display = true;
         }
         $this->lblAddAsset->Display = false;
     }
 }
开发者ID:proxymoron,项目名称:tracmor,代码行数:27,代码来源:receipt_edit.php


示例4: dtgAssetModel_Bind

 protected function dtgAssetModel_Bind()
 {
     // Because we want to enable pagination AND sorting, we need to setup the $objClauses array to send to LoadAll()
     // Remember!  We need to first set the TotalItemCount, which will affect the calcuation of LimitClause below
     $this->dtgAssetModel->TotalItemCount = AssetModel::CountAll();
     // Setup the $objClauses Array
     $objClauses = array();
     // If a column is selected to be sorted, and if that column has a OrderByClause set on it, then let's add
     // the OrderByClause to the $objClauses array
     if ($objClause = $this->dtgAssetModel->OrderByClause) {
         array_push($objClauses, $objClause);
     }
     // Add the LimitClause information, as well
     if ($objClause = $this->dtgAssetModel->LimitClause) {
         array_push($objClauses, $objClause);
     }
     // Set the DataSource to be the array of all AssetModel objects, given the clauses above
     $this->dtgAssetModel->DataSource = AssetModel::LoadAll($objClauses);
 }
开发者ID:proxymoron,项目名称:tracmor,代码行数:19,代码来源:AssetModelListFormBase.class.php


示例5: renderMaster

 /**
  *
  */
 public function renderMaster()
 {
     // Build the master view if necessary
     if (in_array($this->_DeliveryType, array(DELIVERY_TYPE_ALL))) {
         $this->MasterView = $this->masterView();
         // Only get css & ui components if this is NOT a syndication request
         if ($this->SyndicationMethod == SYNDICATION_NONE && is_object($this->Head)) {
             $CssAnchors = AssetModel::getAnchors();
             $this->EventArguments['CssFiles'] =& $this->_CssFiles;
             $this->fireEvent('BeforeAddCss');
             $ETag = AssetModel::eTag();
             $CombineAssets = c('Garden.CombineAssets');
             $ThemeType = isMobile() ? 'mobile' : 'desktop';
             // And now search for/add all css files.
             foreach ($this->_CssFiles as $CssInfo) {
                 $CssFile = $CssInfo['FileName'];
                 if (!array_key_exists('Options', $CssInfo) || !is_array($CssInfo['Options'])) {
                     $CssInfo['Options'] = array();
                 }
                 $Options =& $CssInfo['Options'];
                 // style.css and admin.css deserve some custom processing.
                 if (in_array($CssFile, $CssAnchors)) {
                     if (!$CombineAssets) {
                         // Grab all of the css files from the asset model.
                         $AssetModel = new AssetModel();
                         $CssFiles = $AssetModel->getCssFiles($ThemeType, ucfirst(substr($CssFile, 0, -4)), $ETag);
                         foreach ($CssFiles as $Info) {
                             $this->Head->addCss($Info[1], 'all', true, $CssInfo);
                         }
                     } else {
                         $Basename = substr($CssFile, 0, -4);
                         $this->Head->addCss(url("/asset/css/{$ThemeType}/{$Basename}-{$ETag}.css", '//'), 'all', false, $CssInfo['Options']);
                     }
                     continue;
                 }
                 $AppFolder = $CssInfo['AppFolder'];
                 $LookupFolder = !empty($AppFolder) ? $AppFolder : $this->ApplicationFolder;
                 $Search = AssetModel::CssPath($CssFile, $LookupFolder, $ThemeType);
                 if (!$Search) {
                     continue;
                 }
                 list($Path, $UrlPath) = $Search;
                 if (isUrl($Path)) {
                     $this->Head->AddCss($Path, 'all', val('AddVersion', $Options, true), $Options);
                     continue;
                 } else {
                     // Check to see if there is a CSS cacher.
                     $CssCacher = Gdn::factory('CssCacher');
                     if (!is_null($CssCacher)) {
                         $Path = $CssCacher->get($Path, $AppFolder);
                     }
                     if ($Path !== false) {
                         $Path = substr($Path, strlen(PATH_ROOT));
                         $Path = str_replace(DS, '/', $Path);
                         $this->Head->addCss($Path, 'all', true, $Options);
                     }
                 }
             }
             // Add a custom js file.
             if (arrayHasValue($this->_CssFiles, 'style.css')) {
                 $this->addJsFile('custom.js');
                 // only to non-admin pages.
             }
             $Cdns = array();
             if (!c('Garden.Cdns.Disable', false)) {
                 $Cdns = array('jquery.js' => "//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js");
             }
             // And now search for/add all JS files.
             $this->EventArguments['Cdns'] =& $Cdns;
             $this->fireEvent('AfterJsCdns');
             $this->Head->addScript('', 'text/javascript', false, array('content' => $this->definitionList(false)));
             foreach ($this->_JsFiles as $Index => $JsInfo) {
                 $JsFile = $JsInfo['FileName'];
                 if (!is_array($JsInfo['Options'])) {
                     $JsInfo['Options'] = array();
                 }
                 $Options =& $JsInfo['Options'];
                 if (isset($Cdns[$JsFile])) {
                     $JsFile = $Cdns[$JsFile];
                 }
                 $AppFolder = $JsInfo['AppFolder'];
                 $LookupFolder = !empty($AppFolder) ? $AppFolder : $this->ApplicationFolder;
                 $Search = AssetModel::JsPath($JsFile, $LookupFolder, $ThemeType);
                 if (!$Search) {
                     continue;
                 }
                 list($Path, $UrlPath) = $Search;
                 if ($Path !== false) {
                     $AddVersion = true;
                     if (!isUrl($Path)) {
                         $Path = substr($Path, strlen(PATH_ROOT));
                         $Path = str_replace(DS, '/', $Path);
                         $AddVersion = val('AddVersion', $Options, true);
                     }
                     $this->Head->addScript($Path, 'text/javascript', $AddVersion, $Options);
                     continue;
                 }
//.........这里部分代码省略.........
开发者ID:battaglia01,项目名称:vanilla,代码行数:101,代码来源:class.controller.php


示例6: Css

 /**
  * Gather all of the global styles together.
  * @param string ThemeType Either `desktop` or `mobile`.
  * @param string $Filename The basename of the file to
  * @since 2.1
  */
 public function Css($ThemeType, $Filename)
 {
     $AssetModel = new AssetModel();
     $AssetModel->ServeCss($ThemeType, $Filename);
 }
开发者ID:3marproof,项目名称:vanilla,代码行数:11,代码来源:class.utilitycontroller.php


示例7: assetModel_styleCss_handler

 /**
  * Add our CSS.
  *
  * @param AssetModel $sender
  */
 public function assetModel_styleCss_handler($sender)
 {
     $sender->addCssFile('fileupload.css', 'plugins/FileUpload');
 }
开发者ID:vanilla,项目名称:addons,代码行数:9,代码来源:class.fileupload.plugin.php


示例8: btnNext_Click


//.........这里部分代码省略.........
                             $this->txtMapDefaultValueArray[] = $txtDefaultValue;
                             $lstDefaultValue = new QListBox($this);
                             $lstDefaultValue->Width = 200;
                             $lstDefaultValue->Display = false;
                             $this->lstMapDefaultValueArray[] = $lstDefaultValue;
                             $dtpDate = new QDateTimePicker($this);
                             $dtpDate->DateTimePickerType = QDateTimePickerType::Date;
                             $dtpDate->DateTimePickerFormat = QDateTimePickerFormat::MonthDayYear;
                             $dtpDate->Display = false;
                             $this->dtpDateArray[] = $dtpDate;
                             if (array_key_exists($i, $this->lstMapHeaderArray)) {
                                 $this->lstTramorField_Change(null, $this->lstMapHeaderArray[$i]->ControlId, null);
                             }
                         }
                         $this->arrMapFields[$i]['row1'] = $strFirstRowArray[$i];
                     }
                     $this->btnNext->Text = "Import Now";
                     fclose($file_skipped);
                     // Create Add Field button
                     $btnAddField = new QButton($this);
                     $btnAddField->Text = "Add Field";
                     $btnAddField->AddAction(new QClickEvent(), new QServerAction('btnAddField_Click'));
                     $btnAddField->AddAction(new QEnterKeyEvent(), new QServerAction('btnAddField_Click'));
                     $btnAddField->AddAction(new QEnterKeyEvent(), new QTerminateAction());
                     $this->lstMapHeaderArray[] = $btnAddField;
                 }
             }
         }
     } elseif ($this->intStep == 2) {
         // Step 2 complete
         $blnError = false;
         $blnAssetCode = false;
         $blnLocation = false;
         $blnAssetModelCode = false;
         $blnAssetModelShortDescription = false;
         $blnCategory = false;
         $blnManufacturer = false;
         // Checking errors (Location, Asset Code, Model Short Description, Model Code, Category and Manufacturer must be selected)
         for ($i = 0; $i < count($this->lstMapHeaderArray) - 1; $i++) {
             $lstMapHeader = $this->lstMapHeaderArray[$i];
             $strSelectedValue = strtolower($lstMapHeader->SelectedValue);
             if ($strSelectedValue == "location") {
                 $blnLocation = true;
             } elseif ($strSelectedValue == "asset code") {
                 $blnAssetCode = true;
             } elseif ($strSelectedValue == "asset model short description") {
                 $blnAssetModelShortDescription = true;
             } elseif ($strSelectedValue == "asset model code") {
                 $blnAssetModelCode = true;
             } elseif ($strSelectedValue == "category") {
                 $blnCategory = true;
             } elseif ($strSelectedValue == "manufacturer") {
                 $blnManufacturer = true;
             }
         }
         if ($this->lstMapDefaultValueArray) {
             // Checking errors for required Default Value text fields
             foreach ($this->lstMapDefaultValueArray as $lstDefault) {
                 if ($lstDefault->Display && $lstDefault->Required && !$lstDefault->SelectedValue) {
                     $lstDefault->Warning = "You must select one default value.";
                     $blnError = true;
                     break;
                 } else {
                     $blnError = false;
                     $lstDefault->Warning = "";
                 }
开发者ID:proxymoron,项目名称:tracmor,代码行数:67,代码来源:asset_import.php


示例9: switch

						`%s` AS `%s`
						%s
					WHERE
					1=1
				', $strTableName, $strTableName, $strTableName, $arrCustomFieldSql['strSelect'], $strTableName, $strTableName, $arrCustomFieldSql['strFrom']);
    $objDatabase = QApplication::$Database[1];
    $objDbResult = $objDatabase->Query($strQuery);
    switch ($intEntityQtypeId) {
        case 1:
            $objArray = Asset::InstantiateDbResult($objDbResult);
            break;
        case 2:
            $objArray = InventoryModel::InstantiateDbResult($objDbResult);
            break;
        case 4:
            $objArray = AssetModel::InstantiateDbResult($objDbResult);
            break;
        case 5:
            $objArray = Manufacturer::InstantiateDbResult($objDbResult);
            break;
        case 6:
            $objArray = Category::InstantiateDbResult($objDbResult);
            break;
        case 7:
            $objArray = Company::InstantiateDbResult($objDbResult);
            break;
        case 8:
            $objArray = Contact::InstantiateDbResult($objDbResult);
            break;
        case 9:
            $objArray = Address::InstantiateDbResult($objDbResult);
开发者ID:brustj,项目名称:tracmor,代码行数:31,代码来源:custom_field_helper_migration.php


示例10: assetModel_adminCss_handler

 /**
  * Add the tag admin page CSS.
  *
  * @param AssetModel $sender
  */
 public function assetModel_adminCss_handler($sender)
 {
     $sender->addCssFile('tagadmin.css', 'plugins/Tagging');
 }
开发者ID:caidongyun,项目名称:vanilla,代码行数:9,代码来源:class.tagging.plugin.php


示例11: CountAssetModels

 /**
  * Counts all associated AssetModels
  * @return int
  */
 public function CountAssetModels()
 {
     if (is_null($this->intManufacturerId)) {
         return 0;
     }
     return AssetModel::CountByManufacturerId($this->intManufacturerId);
 }
开发者ID:heshuai64,项目名称:einv2,代码行数:11,代码来源:ManufacturerGen.class.php


示例12: btnAssetModelSearchToolAdd_Click

 public function btnAssetModelSearchToolAdd_Click()
 {
     $this->ctlAssetModelSearchTool->lblWarning->Text = "";
     $intSelectedAssetModelId = $this->ctlAssetModelSearchTool->ctlAssetModelSearch->dtgAssetModel->GetSelected("AssetModelId");
     if (count($intSelectedAssetModelId) < 1) {
         $this->ctlAssetModelSearchTool->lblWarning->Text = "No selected models.";
     } else {
         $lblNewWarning = "";
         foreach (AssetModel::QueryArray(QQ::In(QQN::AssetModel()->AssetModelId, $intSelectedAssetModelId)) as $objNewAssetModel) {
             $blnExists = false;
             foreach ($this->arrAssetModels as $objAssetModel) {
                 if ($objAssetModel->AssetModelId == $objNewAssetModel->AssetModelId) {
                     $blnExists = true;
                 }
             }
             if ($blnExists) {
                 $lblNewWarning .= sprintf("<br />%s - already in list", $objNewAssetModel->AssetModelCode);
             } else {
                 $objAssetModelToAdd = new AssetCustomFieldAssetModel();
                 $objAssetModelToAdd->AssetModelId = $objNewAssetModel->AssetModelId;
                 $objAssetModelToAdd->CustomFieldId = $this->objCustomField->CustomFieldId;
                 array_push($this->arrAssetModels, $objAssetModelToAdd);
             }
         }
         $this->lstAddAssetModel->Warning = $lblNewWarning;
         $this->ctlAssetModelSearchTool->dlgAssetModelSearchTool->HideDialogBox();
     }
     // Uncheck all items but SelectAll checkbox
     $this->UncheckAllItems();
     $this->dtgAssetModels->Refresh();
 }
开发者ID:proxymoron,项目名称:tracmor,代码行数:31,代码来源:custom_field_edit.php


示例13: dtgAssetModel_Bind

 protected function dtgAssetModel_Bind()
 {
     if ($this->blnSearch) {
         $this->assignSearchValues();
     }
     $intCategoryId = $this->intCategoryId;
     $intManufacturerId = $this->intManufacturerId;
     $strDescription = $this->strDescription;
     $strAssetModelCode = $this->strAssetModelCode;
     $arrCustomFields = $this->arrCustomFields;
     $strDateModifiedFirst = $this->strDateModifiedFirst;
     $strDateModifiedLast = $this->strDateModifiedLast;
     $strDateModified = $this->strDateModified;
     $blnAttachment = $this->blnAttachment;
     $objExpansionMap[AssetModel::ExpandCategory] = true;
     $objExpansionMap[AssetModel::ExpandManufacturer] = true;
     // If the search form has been posted
     // if ($intCategoryId || $intManufacturerId || $strDescription || $strAssetModelCode) {
     $this->dtgAssetModel->TotalItemCount = AssetModel::CountBySearch($intCategoryId, $intManufacturerId, $strDescription, $strAssetModelCode, $arrCustomFields, $strDateModified, $strDateModifiedFirst, $strDateModifiedLast, $blnAttachment, $objExpansionMap);
     $this->dtgAssetModel->DataSource = AssetModel::LoadArrayBySearch($intCategoryId, $intManufacturerId, $strDescription, $strAssetModelCode, $arrCustomFields, $strDateModified, $strDateModifiedFirst, $strDateModifiedLast, $blnAttachment, $this->dtgAssetModel->SortInfo, $this->dtgAssetModel->LimitInfo, $objExpansionMap);
     $this->blnSearch = false;
 }
开发者ID:heshuai64,项目名称:einv2,代码行数:22,代码来源:asset_model_list.php


示例14: Refresh

 /**
  * Refresh this MetaControl with Data from the local AssetModelCustomFieldHelper object.
  * @param boolean $blnReload reload AssetModelCustomFieldHelper from the database
  * @return void
  */
 public function Refresh($blnReload = false)
 {
     if ($blnReload) {
         $this->objAssetModelCustomFieldHelper->Reload();
     }
     if ($this->lstAssetModel) {
         $this->lstAssetModel->RemoveAllItems();
         if (!$this->blnEditMode) {
             $this->lstAssetModel->AddItem(QApplication::Translate('- Select One -'), null);
         }
         $objAssetModelArray = AssetModel::LoadAll();
         if ($objAssetModelArray) {
             foreach ($objAssetModelArray as $objAssetModel) {
                 $objListItem = new QListItem($objAssetModel->__toString(), $objAssetModel->AssetModelId);
                 if ($this->objAssetModelCustomFieldHelper->AssetModel && $this->objAssetModelCustomFieldHelper->AssetModel->AssetModelId == $objAssetModel->AssetModelId) {
                     $objListItem->Selected = true;
                 }
                 $this->lstAssetModel->AddItem($objListItem);
             }
         }
     }
     if ($this->lblAssetModelId) {
         $this->lblAssetModelId->Text = $this->objAssetModelCustomFieldHelper->AssetModel ? $this->objAssetModelCustomFieldHelper->AssetModel->__toString() : null;
     }
 }
开发者ID:proxymoron,项目名称:tracmor,代码行数:30,代码来源:AssetModelCustomFieldHelperMetaControlGen.class.php


示例15: Css

 /**
  * Gather all of the global styles together.
  * @param string $Filename 
  * @since 2.1
  */
 public function Css($Basename, $Revision)
 {
     $AssetModel = new AssetModel();
     $AssetModel->ServeCss($Basename, $Revision);
 }
开发者ID:bishopb,项目名称:vanilla,代码行数:10,代码来源:class.utilitycontroller.php


示例16: lstAssetModel_Create

 protected function lstAssetModel_Create()
 {
     $this->lstAssetModel = new QListBox($this);
     $this->lstAssetModel->Name = QApplication::Translate('Asset Model');
     $this->lstAssetModel->Required = true;
     if (!$this->blnEditMode) {
         $this->lstAssetModel->AddItem(QApplication::Translate('- Select One -'), null);
     }
     $objAssetModelArray = AssetModel::LoadAll();
     if ($objAssetModelArray) {
         foreach ($objAssetModelArray as $objAssetModel) {
             $objListItem = new QListItem($objAssetModel->__toString(), $objAssetModel->AssetModelId);
             if ($this->objAsset->AssetModel && $this->objAsset->AssetModel->AssetModelId == $objAssetModel->AssetModelId) {
                 $objListItem->Selected = true;
             }
             $this->lstAssetModel->AddItem($objListItem);
         }
     }
 }
开发者ID:brustj,项目名称:tracmor,代码行数:19,代码来源:AssetEditFormBase.class.php


示例17: GetSoapObjectFromObject

 public static function GetSoapObjectFromObject($objObject, $blnBindRelatedObjects)
 {
     if ($objObject->objAssetModel) {
         $objObject->objAssetModel = AssetModel::GetSoapObjectFromObject($objObject->objAssetModel, false);
     } else {
         if (!$blnBindRelatedObjects) {
             $objObject->intAssetModelId = null;
         }
     }
     if ($objObject->objLocation) {
         $objObject->objLocation = Location::GetSoapObjectFromObject($objObject->objLocation, false);
     } else {
         if (!$blnBindRelatedObjects) {
             $objObject->intLocationId = null;
         }
     }
     if ($objObject->objCreatedByObject) {
         $objObject->objCreatedByObject = UserAccount::GetSoapObjectFromObject($objObject->objCreatedByObject, false);
     } else {
         if (!$blnBindRelatedObjects) {
             $objObject->intCreatedBy = null;
         }
     }
     if ($objObject->dttCreationDate) {
         $objObject->dttCreationDate = $objObject->dttCreationDate->__toString(QDateTime::FormatSoap);
     }
     if ($objObject->objModifiedByObject) {
         $objObject->objModifiedByObject = UserAccount::GetSoapObjectFromObject($objObject->objModifiedByObject, false);
     } else {
         if (!$blnBindRelatedObjects) {
             $objObject->intModifiedBy = null;
         }
     }
     return $objObject;
 }
开发者ID:heshuai64,项目名称:einv2,代码行数:35,代码来源:AssetGen.class.php


示例18: RenderMaster

 /**
  * Undocumented method.
  *
  * @todo Method RenderMaster() needs a description.
  */
 public function RenderMaster()
 {
     // Build the master view if necessary
     if (in_array($this->_DeliveryType, array(DELIVERY_TYPE_ALL))) {
         $this->MasterView = $this->MasterView();
         // Only get css & ui components if this is NOT a syndication request
         if ($this->SyndicationMethod == SYNDICATION_NONE && is_object($this->Head)) {
             //            if (ArrayHasValue($this->_CssFiles, 'style.css')) {
             //               $this->AddCssFile('custom.css');
             //
             //               // Add the theme option's css file.
             //               if ($this->Theme && $this->ThemeOptions) {
             //                  $Filenames = GetValueR('Styles.Value', $this->ThemeOptions);
             //                  if (is_string($Filenames) && $Filenames != '%s')
             //                     $this->_CssFiles[] = array('FileName' => ChangeBasename('custom.css', $Filenames), 'AppFolder' => FALSE, 'Options' => FALSE);
             //               }
             //            } elseif (ArrayHasValue($this->_CssFiles, 'admin.css')) {
             //               $this->AddCssFile('customadmin.css');
             //            }
             $this->EventArguments['CssFiles'] =& $this->_CssFiles;
             $this->FireEvent('BeforeAddCss');
             $ETag = AssetModel::ETag();
             $CombineAssets = C('Garden.CombineAssets');
             $ThemeType = IsMobile() ? 'mobile' : 'desktop';
             // And now search for/add all css files.
             foreach ($this->_CssFiles as $CssInfo) {
                 $CssFile = $CssInfo['FileName'];
                 // style.css and admin.css deserve some custom processing.
                 if (in_array($CssFile, array('style.css', 'admin.css'))) {
                     if (!$CombineAssets) {
                         // Grab all of the css files from the asset model.
                         $AssetModel = new AssetModel();
                         $CssFiles = $AssetModel->GetCssFiles($ThemeType, ucfirst(substr($CssFile, 0, -4)), $ETag);
                         foreach ($CssFiles as $Info) {
                             $this->Head->AddCss($Info[1], 'all', TRUE, $CssInfo);
                         }
                     } else {
                         $Basename = substr($CssFile, 0, -4);
                         $this->Head->AddCss(Url("/utility/css/{$ThemeType}/{$Basename}-{$ETag}.css", '//'), 'all', FALSE, $CssInfo['Options']);
                     }
                     continue;
                 }
                 if (StringBeginsWith($CssFile, 'http')) {
                     $this->Head->AddCss($CssFile, 'all', GetValue('AddVersion', $CssInfo, TRUE), $CssInfo['Options']);
                     continue;
                 } elseif (strpos($CssFile, '/') !== FALSE) {
                     // A direct path to the file was given.
                     $CssPaths = array(CombinePaths(array(PATH_ROOT, str_replace('/', DS, $CssFile))));
                 } else {
                     //                  $CssGlob = preg_replace('/(.*)(\.css)/', '\1*\2', $CssFile);
                     $AppFolder = $CssInfo['AppFolder'];
                     if ($AppFolder == '') {
                         $AppFolder = $this->ApplicationFolder;
                     }
                     // CSS comes from one of four places:
                     $CssPaths = array();
                     if ($this->Theme) {
                         // Use the default filename.
                         $CssPaths[] = PATH_THEMES . DS . $this->Theme . DS . 'design' . DS . $CssFile;
                     }
                     // 3. Application or plugin.
                     if (StringBeginsWith($AppFolder, 'plugins/')) {
                         // The css is coming from a plugin.
                         $AppFolder = substr($AppFolder, strlen('plugins/'));
                         $CssPaths[] = PATH_PLUGINS . "/{$AppFolder}/design/{$CssFile}";
                         $CssPaths[] = PATH_PLUGINS . "/{$AppFolder}/{$CssFile}";
                     } elseif (in_array($AppFolder, array('static', 'resources'))) {
                         // This is a static css file.
                         $CssPaths[] = PATH_ROOT . "/resources/css/{$CssFile}";
                     } else {
                         // Application default. eg. root/applications/app_name/design/
                         $CssPaths[] = PATH_APPLICATIONS . DS . $AppFolder . DS . 'design' . DS . $CssFile;
                     }
                     // 4. Garden default. eg. root/applications/dashboard/design/
                     $CssPaths[] = PATH_APPLICATIONS . DS . 'dashboard' . DS . 'design' . DS . $CssFile;
                 }
                 // Find the first file that matches the path.
                 $CssPath = FALSE;
                 foreach ($CssPaths as $Glob) {
                     $Paths = SafeGlob($Glob);
                     if (is_array($Paths) && count($Paths) > 0) {
                         $CssPath = $Paths[0];
                         break;
                     }
                 }
                 // Check to see if there is a CSS cacher.
                 $CssCacher = Gdn::Factory('CssCacher');
                 if (!is_null($CssCacher)) {
                     $CssPath = $CssCacher->Get($CssPath, $AppFolder);
                 }
                 if ($CssPath !== FALSE) {
                     $CssPath = substr($CssPath, strlen(PATH_ROOT));
                     $CssPath = str_replace(DS, '/', $CssPath);
                     $this->Head->AddCss($CssPath, 'all', TRUE, $CssInfo['Options']);
                 }
//.........这里部分代码省略.........
开发者ID:edward-tsai,项目名称:vanilla4china,代码行数:101,代码来源:class.controller.php


示例19: LoadArrayBySearch

    public static function LoadArrayBySearch($intCategoryId = null, $intManufacturerId = null, $strDescription = null, $strAssetModelCode = null, $arrCustomFields = null, $strDateModified = null, $strDateModifiedFirst = null, $strDateModifiedLast = null, $blnAttachment = null, $strOrderBy = null, $strLimit = null, $objExpansionMap = null)
    {
        AssetModel::ArrayQueryHelper($strOrderBy, $strLimit, $strLimitPrefix, $strLimitSuffix, $strExpandSelect, $strExpandFrom, $objExpansionMap, $objDatabase);
        // Setup QueryExpansion
        $objQueryExpansion = new QQueryExpansion();
        if ($objExpansionMap) {
            try {
                AssetModel::ExpandQuery('asset_model', null, $objExpansionMap, $objQueryExpansion);
            } catch (QCallerException $objExc) {
                $objExc->IncrementOffset();
                throw $objExc;
            }
        }
        $arrSearchSql = AssetModel::GenerateSearchSql($intCategoryId, $intManufacturerId, $strDescription, $strAssetModelCode, $arrCustomFields, $strDateModified, $strDateModifiedFirst, $strDateModifiedLast, $blnAttachment);
        $arrCustomFieldSql = CustomField::GenerateSql(EntityQtype::AssetModel);
        $arrAttachmentSql = Attachment::GenerateSql(EntityQtype::AssetModel);
        $strQuery = sprintf('
				SELECT
					%s
					COUNT( `asset`.`asset_id`) AS asset_count,
					`asset_model`.`asset_model_id` AS `asset_model_id`,
					`asset_model`.`category_id` AS `category_id`,
					`asset_model`.`manufacturer_id` AS `manufacturer_id`,
					`asset_model`.`asset_model_code` AS `asset_model_code`,
					`asset_model`.`short_description` AS `short_description`,
					`asset_model`.`long_description` AS `long_description`,
					`asset_model`.`image_path` AS `image_path`,
					`asset_model`.`created_by` AS `created_by`,
					`asset_model`.`creation_date` AS `creation_date`,
					`asset_model`.`modified_by` AS `modified_by`,
					`asset_model`.`modified_date` AS `modified_date`
					%s
					%s
					%s
				FROM
					`asset_model` AS `asset_model`
					LEFT JOIN `asset` AS `asset` ON `asset_model`.`asset_model_id` = `asset`.`asset_model_id` AND `asset`.`location_id` != 2 AND `asset`.`location_id` != 5
					%s
					%s
					%s
				WHERE
				1=1
				%s
				%s
				%s
				%s
				%s
				%s
				%s
				%s
				%s
				%s
			', $strLimitPrefix, $objQueryExpansion->GetSelectSql(",\n\t\t\t\t\t", ",\n\t\t\t\t\t"), $arrCustomFieldSql['strSelect'], $arrAttachmentSql['strSelect'], $objQueryExpansion->GetFromSql("", "\n\t\t\t\t\t"), $arrCustomFieldSql['strFrom'], $arrAttachmentSql['strFrom'], $arrSearchSql['strCategorySql'], $arrSearchSql['strManufacturerSql'], $arrSearchSql['strDescriptionSql'], $arrSearchSql['strAssetModelCodeSql'], $arrSearchSql['strDateModifiedSql'], $arrSearchSql['strAttachmentSql'], $arrSearchSql['strAuthorizationSql'], $arrAttachmentSql['strGroupBy'], $strOrderBy, $strLimitSuffix);
        $objDbResult = $objDatabase->Query($strQuery);
        return AssetModel::InstantiateDbResult($objDbResult);
    }
开发者ID:heshuai64,项目名称:einv2,代码行数:56,代码来源:AssetModel.class.php


示例20: _AddCLEditor

    private function _AddCLEditor($Sender, $Column = 'Body')
    {
        static $Added = FALSE;
        if ($Added) {
            return;
        }
        // Add the CLEditor to the form
        $Options = array('ie' => 'gt IE 6', 'notie' => TRUE);
        // Exclude IE6
        //$Sender->RemoveJsFile('jquery.autosize.min.js');
        $Sender->AddJsFile('jquery.cleditor' . (Debug() ? '' : '.min') . '.js', 'plugins/cleditor', $Options);
        $CssInfo = AssetModel::CssPath(FALSE, 'cleditor.css', 'plugins/cleditor');
        if ($CssInfo) {
            $CssPath = Asset($CssInfo[1]);
        }
        $Sender->Head->AddString(<<<EOT
<style type="text/css">
a.PreviewButton {
\tdisplay: none !important;
}
</style>
<script type="text/javascript">
\tjQuery(document).ready(function(\$) {
\t\t// Make sure the removal of autogrow does not break anything
\t\t\$.fn.autogrow = function(o) { return; }
\t\t// Attach the editor to comment boxes.
\t\t\$("textarea.BodyBox").livequery(function() {
\t\t\tvar frm = \$(this).closest("form");
\t\t\ted = jQuery(this).cleditor({
            width:"100%", height:"100%",
            controls: "bold italic strikethrough | font size " +
                    "style | color highlight removeformat | bullets numbering | outdent indent | " +
                    "alignleft center alignright | undo redo | " +
                    "image link unlink | pastetext source",
            docType: '<!DOCTYPE html>',
            docCSSFile: "{$CssPath}"
         })[0];
\t\t\tthis.editor = ed; // Support other plugins!
\t\t\tjQuery(frm).bind("clearCommentForm", {editor:ed}, function(e) {
\t\t\t\tfrm.find("textarea").hide();
\t\t\t\te.data.editor.clear();
\t\t\t});
\t\t});
\t});
</script>
EOT
);
        $Added = TRUE;
    }
开发者ID:nilsen,项目名称:addons,代码行数:49,代码来源:default.php



注:本文中的AssetModel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Asset_host类代码示例发布时间:2022-05-23
下一篇:
PHP AssetLoadManager类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap