/** * 创建控制器 */ function generateController(array $args) { $controller_name = array_shift($args); try { $managed_app = new QReflection_Application($this->_managed_app_config); $log = $managed_app->generateController($controller_name)->log(); $ret = 1; } catch (QException $ex) { $error = $this->_getLastError(); $log = arary($ex->getMessage(), $error); $ret = 0; } echo implode("\n", $log); echo "\n\n"; return $ret; }
function __construct() { add_action('init', arary(&$this, '_register_css')); add_action('wp_print_styles', array(&$this, '_enqueue_css')); }
/** * Converts this object to an array for use in the database * @return array */ function toDbArray() { $ret_val = array(); $reflection = new \ReflectionClass($this); $properties = $reflection->getProperties(\ReflectionProperty::IS_PROTECTED); foreach ($properties as $property) { $property_name = $property->getName(); $method_name = 'get' . str_replace("_", "", $property_name); if ($reflection->hasMethod($method_name)) { $value = $this->{$method_name}(); if (is_string($value) && trim($value) == '') { $value = null; } if (is_array($value) && empty($value)) { $value = array(); } if (strtolower($method_name) == 'getid') { $ret_val['_id'] = $value; $ret_val[$property_name] = $value; } else { if ($value instanceof \MongoId) { $ret_val[$property_name] = $value; } else { if ($value instanceof \Mojavi\Form\MojaviForm) { $val = $value->toDbArray(); if (!empty($val)) { $ret_val[$property_name] = $val; } } else { if ($value instanceof \Mojavi\Database\DatabaseResultResource) { foreach ($value as $item) { $val = $item->toDbArray(); if (!empty($val)) { $ret_val[$property_name][] = $val; } } } else { if (is_array($value)) { if (count($value) > 0) { foreach ($value as $key => $item) { if ($item instanceof \Mojavi\Form\MojaviForm) { $val = $item->toDbArray(); if (!empty($val)) { $ret_val[$property_name][$key] = $val; } } else { if (is_string($item) && trim($item) == '') { $item = null; } if (is_array($item) && empty($item)) { $item = arary(); } $ret_val[$property_name][$key] = $item; } } } else { $ret_val[$property_name] = $value; } } else { $ret_val[$property_name] = $value; } } } } } } else { $value = $this->{$property_name}; if (is_string($value) && trim($value) == '') { $value = null; } if (is_array($value) && empty($value)) { $value = array(); } $ret_val[$property_name] = $value; } } return $ret_val; }
if (isset($_POST['update'])) { extract($_POST); $treeFilling = new TreeFillingVO(); $treeFilling->currentCount = $currentCount; $treeFilling->currentVolume = $currentVolume; $treeFilling->previousCount = $previousCount; $treeFilling->previousVolume = $previousVolume; $treeFilling->treetype_id = $treetype_id; $treeFillingArray = (array) unserialize($_SESSION['treeFillingArray']); if (isset($treeFillingArray)) { $treeFillingArray[$treetype_id] = $treeFilling; //count($treeFillingArray); $_SESSION['treeFillingArray'] = serialize($treeFillingArray); $treeFillingArray = (array) unserialize($_SESSION['treeFillingArray']); } else { $treeFillingArray = arary(); $treeFillingArray[$treetype_id] = $treeFilling; $_SESSION['treeFillingArray'] = serialize($treeFillingArray); } ob_end_clean(); header("location:index.php?page=addConversion&f=in&markId=" . $_REQUEST['markId']); } include 'header.php'; $labelPrevious = 'Previous'; $labelValue = 'Value'; $labelVolume = 'Volume'; $labelCurrent = 'Current'; ?> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />