当前位置: 首页>>代码示例>>PHP>>正文


PHP Wizard::getAllValues方法代码示例

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


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

示例1: updateFromWizard

 /**
  * Get the values submitted in the wizard and update the Record with them.
  * 
  * @param object $record
  * @param object $wizard
  * @return void
  * @access public
  * @since 10/19/04
  */
 function updateFromWizard(Record $record, Wizard $wizard)
 {
     $recordStructure = $record->getRecordStructure();
     $recordStructureId = $recordStructure->getId();
     $properties = $wizard->getAllValues();
     $values = $properties["record"];
     // Delete the old parts
     $parts = $record->getParts();
     while ($parts->hasNext()) {
         $part = $parts->next();
         $partId = $part->getId();
         $record->deletePart($partId);
     }
     $parts = $record->getParts();
     if ($parts->hasNext()) {
         print "have a part!!!";
     }
     // debug
     // Go through each of the partStructures and save any values as parts.
     $partStructures = $recordStructure->getPartStructures();
     while ($partStructures->hasNext()) {
         $partStructure = $partStructures->next();
         $partStructureId = $partStructure->getId();
         $partStructureType = $partStructure->getType();
         $valueObjClass = $partStructureType->getKeyword();
         $id = str_replace(".", "_", $partStructureId->getIdString());
         if ($partStructure->isRepeatable()) {
             // Add a part for each property
             foreach (array_keys($values[$id]) as $valueIndex) {
                 $value = $values[$id][$valueIndex]["value"];
                 $newPart = $record->createPart($partStructureId, $value);
             }
         } else {
             // Add a part for the property
             $value = $values[$id];
             $newPart = $record->createPart($partStructureId, $value);
         }
     }
 }
开发者ID:adamfranco,项目名称:polyphony,代码行数:48,代码来源:DataManagerPrimativesModule.class.php

示例2: updateFromWizard

 /**
  * Get the values submitted in the wizard and update the Record with them.
  * 
  * @param object $record
  * @param object $wizard
  * @return void
  * @access public
  * @since 10/19/04
  */
 function updateFromWizard(Record $record, Wizard $wizard)
 {
     $properties = $wizard->getAllValues();
     $values = $properties["record"];
     printpre($properties);
     // Get all the parts
     $partIterator = $record->getParts();
     $parts = array();
     while ($partIterator->hasNext()) {
         $part = $partIterator->next();
         $partStructure = $part->getPartStructure();
         $partStructureId = $partStructure->getId();
         $parts[$partStructureId->getIdString()] = $part;
     }
     // if a new File was uploaded, store it.
     if ($values['file_upload']['tmp_name'] && $values['file_upload']['name']) {
         $name = $values['file_upload']['name'];
         $tmpName = $values['file_upload']['tmp_name'];
         $mimeType = $values['file_upload']['type'];
         // If we weren't passed a mime type or were passed the generic
         // application/octet-stream type, see if we can figure out the
         // type.
         if (!$mimeType || $mimeType == 'application/octet-stream') {
             $mime = Services::getService("MIME");
             $mimeType = $mime->getMimeTypeForFileName($name);
         }
         $parts['FILE_DATA']->updateValue(file_get_contents($tmpName));
         $parts['FILE_NAME']->updateValue($name);
         $parts['MIME_TYPE']->updateValue($mimeType);
     }
     // If we've uploaded a thumbnail, safe it.
     if ($values['thumbnail_upload']['tmp_name'] && $values['thumbnail_upload']['name']) {
         $name = $values['thumbnail_upload']['name'];
         $tmpName = $values['thumbnail_upload']['tmp_name'];
         $mimeType = $values['thumbnail_upload']['type'];
         // If we weren't passed a mime type or were passed the generic
         // application/octet-stream type, see if we can figure out the
         // type.
         if (!$mimeType || $mimeType == 'application/octet-stream') {
             $mime = Services::getService("MIME");
             $mimeType = $mime->getMimeTypeForFileName($name);
         }
         $parts['THUMBNAIL_DATA']->updateValue(file_get_contents($tmpName));
         $parts['THUMBNAIL_MIME_TYPE']->updateValue($mimeType);
     } else {
         if ($values['file_upload']['tmp_name'] && $values['file_upload']['name']) {
             $imageProcessor = Services::getService("ImageProcessor");
             // If our image format is supported by the image processor,
             // generate a thumbnail.
             if ($imageProcessor->isFormatSupported($mimeType)) {
                 $parts['THUMBNAIL_DATA']->updateValue($imageProcessor->generateThumbnailData($mimeType, file_get_contents($tmpName)));
                 $parts['THUMBNAIL_MIME_TYPE']->updateValue($imageProcessor->getThumbnailFormat());
             } else {
                 $parts['THUMBNAIL_DATA']->updateValue("");
                 $parts['THUMBNAIL_MIME_TYPE']->updateValue("NULL");
             }
         }
     }
     // if the "use custom" box was checked store the name.
     if ($values['use_custom_filename']) {
         $parts['FILE_NAME']->updateValue($values['file_name']);
     }
     // if the "use custom" box was checked store the mime type.
     if ($values['use_custom_type']) {
         $parts['MIME_TYPE']->updateValue($values['mime_type']);
     }
     // if the "use custom" box was checked store the height.
     if ($values['use_custom_height'] && preg_match("/^([0-9]+)px\$/", $values['height'], $matches)) {
         $dimArray = $parts['DIMENSIONS']->getValue();
         $dimArray[1] = $matches[1];
         print "Setting DIMENSIONS to:";
         printpre($dimArray);
         $parts['DIMENSIONS']->updateValue($dimArray);
     }
     unset($dimArray, $matches);
     // if the "use custom" box was checked store the width.
     if ($values['use_custom_width'] && preg_match("/^([0-9]+)px\$/", $values['width'], $matches)) {
         $dimArray = $parts['DIMENSIONS']->getValue();
         $dimArray[0] = $matches[1];
         print "Setting DIMENSIONS to:";
         printpre($dimArray);
         $parts['DIMENSIONS']->updateValue($dimArray);
     }
     unset($dimArray, $matches);
     // if the "use custom" box was checked store the height.
     if ($values['use_custom_thumbnail_height'] && preg_match("/^([0-9]+)px\$/", $values['thumbnail_height'], $matches)) {
         $dimArray = $parts['THUMBNAIL_DIMENSIONS']->getValue();
         $dimArray[1] = $matches[1];
         print "Setting THUMBNAIL_DIMENSIONS to:";
         printpre($dimArray);
         $parts['THUMBNAIL_DIMENSIONS']->updateValue($dimArray);
//.........这里部分代码省略.........
开发者ID:adamfranco,项目名称:polyphony,代码行数:101,代码来源:HarmoniFileModule.class.php


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