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


PHP Value::get_instance方法代码示例

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


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

示例1: __construct

 /**
  * @see DataPermissionInterface::__construct()
  * @param string type
  * @param integer $id
  */
 function __construct($type, $id)
 {
     if (is_numeric($id) and $type) {
         $this->type = $type;
         switch ($type) {
             case "file":
                 $this->id = $id;
                 $this->object = File::get_instance($id);
                 break;
             case "value":
                 $this->id = $id;
                 $this->object = Value::get_instance($id);
                 break;
             case "parameter":
                 $this->id = $id;
                 $this->object = Parameter::get_instance($id);
                 break;
             case "folder":
                 $this->id = $id;
                 $this->object = Folder::get_instance($id);
                 break;
         }
         $this->automatic = $this->object->get_automatic();
         $this->permission = $this->object->get_permission();
         $this->owner_id = $this->object->get_owner_id();
         $this->owner_group_id = $this->object->get_owner_group_id();
     } else {
         $this->id = null;
         $this->object = null;
     }
 }
开发者ID:suxinde2009,项目名称:www,代码行数:36,代码来源:data_permission.class.php

示例2: __construct

 /**
  * @param integer $value_id
  * @param integer $type_id
  * @param integer $folder_id
  * @param array $value_obj_content_array
  */
 function __construct($value_id = null, $type_id = null, $folder_id = null, $value_obj_content_array = null)
 {
     if ($value_id) {
         $value_obj = Value::get_instance($value_id);
         if (is_array($value_obj_content_array)) {
             $value_obj->set_content_array($value_obj_content_array);
         }
         $this->shape_array = $value_obj->get_value_shape();
         $this->content_array = $value_obj->get_value_content(false);
     } elseif ($type_id) {
         $value_obj = Value::get_instance(null);
         if (is_array($value_obj_content_array)) {
             $value_obj->set_content_array($value_obj_content_array);
         }
         $this->shape_array = $value_obj->get_value_shape($type_id, $folder_id);
         $this->content_array = $value_obj->get_value_content(false, $type_id, $folder_id);
     }
 }
开发者ID:suxinde2009,项目名称:www,代码行数:24,代码来源:value_form.io.php

示例3: get_description

 /**
  * @see ProjectInterface::get_description()
  * @return string
  */
 public function get_description()
 {
     if ($this->project_id) {
         $project_item = new ProjectItem($this->project_id);
         $item_array = $project_item->get_project_items();
         if (is_array($item_array) and count($item_array) >= 1) {
             foreach ($item_array as $item_key => $item_value) {
                 if (DataEntity::is_kind_of("value", $item_value) == true) {
                     $data_entity_id = DataEntity::get_entry_by_item_id($item_value);
                     $value_id = Value::get_value_id_by_data_entity_id($data_entity_id);
                     if (Value::is_entry_type_of($value_id, 2) == true) {
                         $description_id = $value_id;
                     }
                 }
             }
         }
         $value = Value::get_instance($description_id);
         if ($value->get_type_id() == 2) {
             return unserialize($value->get_value());
         }
     } else {
         return null;
     }
 }
开发者ID:suxinde2009,项目名称:www,代码行数:28,代码来源:project.class.php

示例4: change_permission

 /**
  * @param string $permission_array
  * @param string $type
  * @return string
  * @throws DataSecurityAccessDeniedException
  */
 public static function change_permission($permission_array, $type)
 {
     global $user;
     $permissions = (array) $permission_array;
     switch ($type) {
         case "File":
             $id = $_POST['file_id'];
             $object = File::get_instance($id);
             break;
         case "Folder":
             $id = $_POST['folder_id'];
             $object = Folder::get_instance($id);
             break;
         case "Value":
             $id = $_POST['value_id'];
             $object = Value::get_instance($id);
             break;
         case "Parameter":
             $id = $_POST['parameter_id'];
             $object = Parameter::get_instance($id);
             break;
     }
     if ($object->is_control_access() == true) {
         $full_access = true;
     } else {
         $full_access = false;
     }
     if ($object->get_owner_id() == $user->get_user_id()) {
         $user_access = true;
     } else {
         $user_access = false;
     }
     if ($full_access == true or $user_access == true) {
         $type = strtolower($type);
         $id = intval($id);
         echo $id;
         $data_permission = new DataPermission($type, $id);
         $paramquery = $_GET;
         unset($paramquery['action']);
         unset($paramquery['nextpage']);
         $params = http_build_query($paramquery, '', '&');
         if ($data_permission->set_permission_array($permissions) == true) {
             return "1";
         } else {
             return "0";
         }
     } else {
         throw new DataSecurityAccessDeniedException();
     }
 }
开发者ID:suxinde2009,项目名称:www,代码行数:56,代码来源:data.ajax.php

示例5: delete_version

 /**
  * @throws ValueIDMissingException
  * @throws ValueVersionIDMissingException
  * @throws DataSecurityAccessDeniedException
  */
 public static function delete_version()
 {
     if ($_GET['value_id']) {
         if ($_GET['version']) {
             $value = Value::get_instance($_GET['value_id']);
             if ($value->is_delete_access()) {
                 if ($_GET['sure'] != "true") {
                     $template = new HTMLTemplate("data/value_delete_version.html");
                     $paramquery = $_GET;
                     $paramquery['sure'] = "true";
                     $params = http_build_query($paramquery);
                     $template->set_var("yes_params", $params);
                     $paramquery = $_GET;
                     $paramquery['action'] = "value_history";
                     unset($paramquery['sure']);
                     $params = http_build_query($paramquery);
                     $template->set_var("no_params", $params);
                     $template->output();
                 } else {
                     if (($return_value = $value->delete_version($_GET['version'])) != 0) {
                         if ($return_value == 1) {
                             $paramquery = $_GET;
                             $paramquery['action'] = "value_history";
                             unset($paramquery['sure']);
                             unset($paramquery['version']);
                             $params = http_build_query($paramquery);
                         } else {
                             $paramquery = $_GET;
                             unset($paramquery['sure']);
                             unset($paramquery['action']);
                             unset($paramquery['value_id']);
                             $params = http_build_query($paramquery);
                         }
                         Common_IO::step_proceed($params, "Delete Value", "Operation Successful", null);
                     } else {
                         $paramquery = $_GET;
                         unset($paramquery['sure']);
                         unset($paramquery['action']);
                         unset($paramquery['value_id']);
                         $params = http_build_query($paramquery);
                         Common_IO::step_proceed($params, "Delete Value", "Operation Failed", null);
                     }
                 }
             } else {
                 throw new DataSecurityAccessDeniedException();
             }
         } else {
             throw new ValueVersionIDMissingException();
         }
     } else {
         throw new ValueIDMissingException();
     }
 }
开发者ID:suxinde2009,项目名称:www,代码行数:58,代码来源:value.io.php

示例6: delete_value

 /**
  * @param integer $value_id
  * @return string
  * @throws DataSecurityAccessDeniedException
  */
 private static function delete_value($value_id)
 {
     $value = Value::get_instance($value_id);
     if ($value->is_delete_access()) {
         $value->delete();
         return "1";
     } else {
         throw new DataSecurityAccessDeniedException();
     }
 }
开发者ID:suxinde2009,项目名称:www,代码行数:15,代码来源:value.ajax.php

示例7: get_data_item_report

 /**
  * @param string $sql
  * @param integer $item_id
  * @param object $pdf
  * @return object
  */
 public static function get_data_item_report($sql, $item_id, $pdf)
 {
     global $regional;
     if ($sql and is_object($pdf)) {
         // Values
         $value_array = Data_Wrapper::list_item_values($sql);
         if (is_array($value_array) and count($value_array) >= 1) {
             foreach ($value_array as $key => $value) {
                 $value_object = Value::get_instance($value['id']);
                 $value_object_value_array = $value_object->get_value_content(false);
                 $pdf->addPage();
                 $pdf->SetFont('dejavusans', 'B', 14, '', true);
                 $pdf->Write(0, 'Value - ' . $value_object->get_name() . '', '', 0, 'C', true, 0, false, false, 0);
                 $pdf->Write(0, '', '', 0, 'L', true, 0, false, false, 0);
                 $pdf->SetFont('dejavusans', '', 12, '', true);
                 if (is_array($value_object_value_array) and count($value_object_value_array) >= 1) {
                     foreach ($value_object_value_array as $sub_key => $sub_value) {
                         $sub_value['content'][0] = str_replace("\n", "<br />", $sub_value['content'][0]);
                         if ($sub_value['type'] == "textarea") {
                             $pdf->SetFont('dejavusans', 'B', 12, '', true);
                             $pdf->MultiCell(190, 9, $sub_value['title'], 1, 'L', 1, 1, '', '', true, 0, true, true, 0, "T");
                             $pdf->SetFont('dejavusans', '', 12, '', true);
                             $string_height = $pdf->getStringHeight(110, $sub_value['content'][0], true, true, '', 1);
                             $pdf->MultiCell(190, $string_height, $sub_value['content'][0], 1, 'L', 1, 1, '', '', true, 0, true, true, 0, "T");
                         } else {
                             $pdf->SetFont('dejavusans', 'B', 12, '', true);
                             $string_height1 = $pdf->getStringHeight(80, $sub_value['title'], true, true, '', 1);
                             $pdf->SetFont('dejavusans', '', 12, '', true);
                             $string_height2 = $pdf->getStringHeight(110, $sub_value['content'][0], true, true, '', 1);
                             if ($string_height1 > $string_height2) {
                                 $height = $string_height1;
                             } else {
                                 $height = $string_height2;
                             }
                             $pdf->SetFont('dejavusans', 'B', 12, '', true);
                             $pdf->MultiCell(80, $height, $sub_value['title'], 1, 'L', 1, 0, '', '', true, 0, true, true, 0, "T");
                             $pdf->SetFont('dejavusans', '', 12, '', true);
                             $pdf->MultiCell(110, $height, $sub_value['content'][0], 1, 'L', 1, 1, '', '', true, 0, true, true, 0, "T");
                         }
                     }
                 }
                 $value_object_version_array = $value_object->get_value_internal_revisions();
                 if (is_array($value_object_version_array) and count($value_object_version_array) >= 1) {
                     $pdf->Write(0, '', '', 0, 'L', true, 0, false, false, 0);
                     $header_array = array(array("name" => "name", "title" => "Name", "width" => 60), array("name" => "version", "title" => "Version", "width" => 25), array("name" => "datetime", "title" => "Date/Time", "width" => 55), array("name" => "user", "title" => "User", "width" => 50));
                     $report_table = new ReportTable_IO($pdf, '', '12');
                     $report_table->add_header($header_array);
                     foreach ($value_object_version_array as $sub_key => $sub_value) {
                         $value_version = clone $value_object;
                         $value_version->open_internal_revision($sub_value);
                         $datetime_handler = new DatetimeHandler($value_version->get_datetime());
                         $owner = new User($value_version->get_version_owner_id());
                         $line_array = array(array("name" => "name", "content" => $value_version->get_name()), array("name" => "version", "content" => $value_version->get_version()), array("name" => "datetime", "content" => $datetime_handler->get_datetime(false)), array("name" => "user", "content" => $owner->get_full_name(true)));
                         $report_table->add_line($line_array);
                     }
                 }
                 $pdf = $report_table->get_pdf();
             }
         }
         // Files
         $file_array = Data_Wrapper::list_item_files($sql, null, null, null, null);
         if (is_array($file_array) and count($file_array) >= 1) {
             $pdf->addPage();
             $pdf->SetFont('dejavusans', 'B', 14, '', true);
             $pdf->Write(0, 'Files', '', 0, 'C', true, 0, false, false, 0);
             $pdf->Write(0, '', '', 0, 'L', true, 0, false, false, 0);
             $pdf->SetFont('dejavusans', '', 14, '', true);
             $header_array = array(array("name" => "name", "title" => "Name", "width" => 62), array("name" => "version", "title" => "Version", "width" => 25), array("name" => "datetime", "title" => "Date/Time", "width" => 55), array("name" => "user", "title" => "User", "width" => 48));
             $report_table = new ReportTable_IO($pdf, '', '12');
             $report_table->add_header($header_array);
             foreach ($file_array as $key => $value) {
                 $file = File::get_instance($value['id']);
                 $owner = new User($value['owner_id']);
                 $datetime_handler = new DatetimeHandler($value['datetime']);
                 $line_array = array(array("name" => "name", "content" => $value['name']), array("name" => "version", "content" => $file->get_version()), array("name" => "datetime", "content" => $datetime_handler->get_datetime(false)), array("name" => "user", "content" => $owner->get_full_name(true)));
                 $report_table->add_line($line_array);
             }
             $pdf = $report_table->get_pdf();
         }
         // Parameters
         $parameter_array = Data_Wrapper::list_item_parameters($sql);
         if (is_array($parameter_array) and count($parameter_array) >= 1) {
             foreach ($parameter_array as $key => $value) {
                 $parameter_object = Parameter::get_instance($value['id']);
                 $parameter_template = new ParameterTemplate($parameter_object->get_template_id());
                 $parameter_template_field_array = $parameter_template->get_fields();
                 $parameter_template_limit_array = $parameter_template->get_limits();
                 $parameter_value_array = $parameter_object->get_values();
                 $parameter_method_array = $parameter_object->get_methods();
                 $parameter_status_array = $parameter_object->get_status();
                 $parameter_limit_array = $parameter_object->geT_limits();
                 $pdf->addPage();
                 $pdf->SetFont('dejavusans', 'B', 14, '', true);
                 $pdf->Write(0, '' . $parameter_object->get_name() . '', '', 0, 'L', true, 0, false, false, 0);
//.........这里部分代码省略.........
开发者ID:suxinde2009,项目名称:www,代码行数:101,代码来源:data_report.io.php

示例8: get_context_sensitive_value_menu

 /**
  * @param integer $value_id
  * @return string
  */
 public static function get_context_sensitive_value_menu($value_id)
 {
     global $user;
     $value = Value::get_instance($value_id);
     $html = "";
     if ($value->is_read_access()) {
         $history_link = "index.php?username=" . $_GET['username'] . "&session_id=" . $_GET['session_id'] . "&nav=data&value_id=" . $value_id . "&action=value_history";
         $html .= "<img src='images/icons/history.png' alt='' /><a href='" . $history_link . "' class='DataBrowserDialogLinkFollowDirectly'>History</a><br/>";
     }
     if ($value->is_control_access() == true or $value->get_owner_id() == $user->get_user_id()) {
         $change_permission_link = "run=value_permission&value_id=" . $value_id;
         $html .= "<img src='images/icons/permissions.png' alt='' /><a href='" . $change_permission_link . "' class='DataBrowserDialogLinkChangePermission'>Change permission</a><br/>";
     }
     if ($value->is_delete_access()) {
         $delete_link = "run=value_delete&value_id=" . $value_id;
         $html .= "<img src='images/icons/delete.png' alt='' /><a href='" . $delete_link . "' class='DataBrowserDialogLinkDelete'>Delete</a><br/>";
     }
     if ($value->is_read_access()) {
         $open_link = "index.php?username=" . $_GET['username'] . "&session_id=" . $_GET['session_id'] . "&nav=data&value_id=" . $value_id . "&action=value_detail";
         $html .= "<img src='images/icons/file_open.png' alt='' /><a href='" . $open_link . "' class='DataBrowserDialogLinkFollowDirectly'>Open / Edit</a><br/>";
     }
     return $html;
 }
开发者ID:suxinde2009,项目名称:www,代码行数:27,代码来源:data_browser.ajax.php

示例9: clone_sample


//.........这里部分代码省略.........
                     $sample_has_location_access = new SampleHasLocation_Access(null);
                     if ($sample_has_location_access->create($sample_id, $current_sample_has_location_access->get_location_id(), $user->get_user_id()) == null) {
                         throw new SampleCloneLocationException();
                     }
                 }
             } else {
                 $add_new_location = true;
             }
             if (is_numeric($location_id) and $add_new_location == true and $location_id > 0) {
                 // Create First Location
                 $sample_has_location_access = new SampleHasLocation_Access(null);
                 if ($sample_has_location_access->create($sample_id, $location_id, $user->get_user_id()) == null) {
                     throw new SampleCloneCreateLocationException("Could not create location");
                 }
             }
             if (is_array($value_array) and count($item_array) >= 1) {
                 $value_item_array = array();
                 $value_data_array = array();
                 foreach ($value_array as $key => $value) {
                     $key = str_replace("value-", "", $key);
                     $key_array = explode("-", $key, 2);
                     if ($key_array[0] == "item") {
                         $value_item_array[$key_array[1]] = $value;
                     } elseif (is_numeric($key_array[0])) {
                         $value_data_array[$key_array[0]][$key_array[1]] = $value;
                     }
                 }
                 if (is_array($value_item_array) and count($value_item_array) >= 1) {
                     foreach ($value_item_array as $key => $value) {
                         $gid = SampleItem::get_gid_by_item_id_and_sample_id($value, $source_sample_id);
                         $data_entity_id = DataEntity::get_entry_by_item_id($value);
                         $value_id = Value::get_value_id_by_data_entity_id($data_entity_id);
                         if (is_numeric($value_id)) {
                             $value_obj = Value::get_instance($value_id);
                             $parent_folder_id = $value_obj->get_parent_folder_id();
                             $value_type_id = $value_obj->get_type_id();
                             if ($parent_folder_id == $source_sample_folder_id) {
                                 $new_folder_id = $this->sample_folder_id;
                             } else {
                                 $folder_name = Folder::get_name_by_id($parent_folder_id);
                                 $new_folder_id = array_search(trim(strtolower($folder_name)), $sub_folder_name_array);
                             }
                             if (is_numeric($new_folder_id) and is_numeric($value_type_id)) {
                                 $new_value_obj = Value::get_instance(null);
                                 $new_value_obj->create($new_folder_id, $user->get_user_id(), $value_type_id, $value_data_array[$key]);
                                 $new_value_item_id = $new_value_obj->get_item_id();
                                 $sample_item = new SampleItem($sample_id);
                                 $sample_item->set_gid($gid);
                                 if ($sample_item->set_item_id($new_value_item_id) == false) {
                                     throw new SampleCloneValueException();
                                 }
                                 if ($sample_item->link_item() == false) {
                                     throw new SampleCloneValueException();
                                 }
                             }
                         }
                     }
                 }
             }
             if (is_array($item_array) and count($item_array) >= 1) {
                 $item_type_array = array();
                 $item_data_array = array();
                 foreach ($item_array as $key => $value) {
                     if ($value[1] == "1") {
                         $item_explode_array = explode("-", $value[0], 2);
                         if (!in_array($item_explode_array[0], $item_type_array)) {
开发者ID:suxinde2009,项目名称:www,代码行数:67,代码来源:sample.class.php

示例10: delete

 /**
  * @see FolderInterface::delete()
  * @param bool $recursive
  * @param bool $content
  * @return bool
  */
 public function delete($recursive, $content)
 {
     global $transaction;
     if ($this->folder_id and $this->folder) {
         $transaction_id = $transaction->begin();
         $subfolder_array = $this->get_subfolder_array();
         if (is_array($subfolder_array) and $recursive == false or $content == false and $recursive == true) {
             return false;
         } else {
             if ($recursive == true and $content == true) {
                 if (is_array($subfolder_array)) {
                     foreach ($subfolder_array as $key => $value) {
                         $folder = Folder::get_instance($value);
                         if ($folder->delete(true, true) == false) {
                             if ($transaction_id != null) {
                                 $transaction->rollback($transaction_id);
                             }
                             return false;
                         } else {
                             if ($transaction_id != null) {
                                 // Avoids Ghost-Folders
                                 $transaction->commit($transaction_id);
                                 $transaction_id = $transaction->begin();
                             }
                         }
                     }
                 }
             }
             // Folder-Content
             $data_entity_array = $this->get_children("without_linked");
             if (is_array($data_entity_array) and count($data_entity_array) >= 1) {
                 foreach ($data_entity_array as $key => $value) {
                     // Files
                     if (($file_id = File::get_file_id_by_data_entity_id($value)) != null) {
                         $file = File::get_instance($file_id);
                         $file_delete = $file->delete();
                         if ($file_delete == false) {
                             if ($transaction_id != null) {
                                 $transaction->rollback($transaction_id);
                             }
                             return false;
                         } else {
                             if ($transaction_id != null) {
                                 // Avoids Ghost-Files
                                 $transaction->commit($transaction_id);
                                 $transaction_id = $transaction->begin();
                             }
                         }
                     }
                     // Values
                     if (($value_id = Value::get_value_id_by_data_entity_id($value)) != null) {
                         $value_obj = Value::get_instance($value_id);
                         if ($value_obj->delete() == false) {
                             if ($transaction_id != null) {
                                 $transaction->rollback($transaction_id);
                             }
                             return false;
                         }
                     }
                     // Virtual Folders
                     if (($virtual_folder_id = VirtualFolder::get_virtual_folder_id_by_data_entity_id($value)) != null) {
                         $virtual_folder = new VirtualFolder($virtual_folder_id);
                         if ($virtual_folder->delete() == false) {
                             if ($transaction_id != null) {
                                 $transaction->rollback($transaction_id);
                             }
                             return false;
                         }
                     }
                 }
             }
             // Linked Folder-Content (e.g. from sub-items)
             $data_entity_array = $this->get_children("linked_only");
             if (is_array($data_entity_array) and count($data_entity_array) >= 1) {
                 foreach ($data_entity_array as $key => $value) {
                     if ($this->unset_child($value) == false) {
                         if ($transaction_id != null) {
                             $transaction->rollback($transaction_id);
                         }
                         return false;
                     }
                 }
             }
             $path = constant("BASE_DIR") . "/" . $this->folder->get_path();
             if (file_exists($path)) {
                 $garbage_file_array = scandir($path);
                 if (is_array($garbage_file_array) and count($garbage_file_array) >= 3) {
                     foreach ($garbage_file_array as $key => $value) {
                         if ($key != 0 and $key != 1) {
                             unlink($path . "/" . $value);
                         }
                     }
                 }
             }
//.........这里部分代码省略.........
开发者ID:suxinde2009,项目名称:www,代码行数:101,代码来源:folder.class.php

示例11: change_group

 /**
  * @throws FolderIDMissingException
  */
 public static function change_group()
 {
     if ($_GET['file_id'] or $_GET['value_id'] or $_GET['parameter_id'] or $_GET['folder_id']) {
         if ($_GET['file_id']) {
             $id = $_GET['file_id'];
             $object = File::get_instance($id);
             $type = "file";
             $title = $object->get_name();
         }
         if ($_GET['value_id']) {
             $id = $_GET['value_id'];
             $object = Value::get_instance($id);
             $type = "value";
             $title = $object->get_type_name();
         }
         if ($_GET['parameter_id']) {
             $id = $_GET['parameter_id'];
             $object = Parameter::get_instance($id);
             $type = "parameter";
             $title = $object->get_name();
         }
         if ($_GET['folder_id']) {
             $id = $_GET['folder_id'];
             $object = Folder::get_instance($id);
             $type = "folder";
             $title = $object->get_name();
         }
     } else {
         throw new FolderIDMissingException();
     }
     if ($object->is_control_access() == true) {
         $data_permission = new DataPermission($type, $id);
         if (!$_GET['nextpage']) {
             $template = new HTMLTemplate("data/data_change_group.html");
             $paramquery = $_GET;
             $paramquery['nextpage'] = "1";
             $params = http_build_query($paramquery, '', '&#38;');
             $template->set_var("params", $params);
             $template->set_var("title", $title);
             $template->set_var("error", "");
             $group_array = Group::list_groups();
             $result = array();
             $counter = 0;
             foreach ($group_array as $key => $value) {
                 $group = new Group($value);
                 $result[$counter]['value'] = $value;
                 $result[$counter]['content'] = $group->get_name();
                 $counter++;
             }
             $template->set_var("option", $result);
             $paramquery = $_GET;
             $paramquery['action'] = "permission";
             unset($paramquery['nextpage']);
             $params = http_build_query($paramquery, '', '&#38;');
             $template->set_var("back_link", $params);
             $template->output();
         } else {
             $paramquery = $_GET;
             $paramquery['action'] = "permission";
             unset($paramquery['nextpage']);
             $params = http_build_query($paramquery, '', '&#38;');
             if ($data_permission->set_owner_group_id($_POST['group']) == true) {
                 Common_IO::step_proceed($params, "Permission: " . $title . "", "Changes saved succesful", null);
             } else {
                 Common_IO::step_proceed($params, "Permission: " . $title . "", "Operation failed", null);
             }
         }
     } else {
         throw new DataSecuriyAccessDeniedException();
     }
 }
开发者ID:suxinde2009,项目名称:www,代码行数:74,代码来源:data.io.php

示例12: list_data

 /**
  * @param string $json_column_array
  * @param string $json_argument_array
  * @param string $css_page_id
  * @param string $css_row_sort_id
  * @param string $entries_per_page
  * @param string $page
  * @param string $sortvalue
  * @param string $sortmethod
  * @return string
  * @throws BaseAjaxArgumentMissingException
  */
 public static function list_data($json_column_array, $json_argument_array, $css_page_id, $css_row_sort_id, $entries_per_page, $page, $sortvalue, $sortmethod)
 {
     $argument_array = json_decode($json_argument_array);
     if (is_array($argument_array)) {
         $folder_id = $argument_array[0][1];
         $name = $argument_array[1][1];
         $list_request = new ListRequest_IO();
         $list_request->set_column_array($json_column_array);
         if (!is_numeric($entries_per_page) or $entries_per_page < 1) {
             $entries_per_page = 20;
         }
         $list_array = Data_Wrapper::list_search_ffv($folder_id, $name, $sortvalue, $sortmethod, $page * $entries_per_page - $entries_per_page, $page * $entries_per_page);
         if (is_array($list_array) and count($list_array) >= 1) {
             foreach ($list_array as $key => $value) {
                 $datetime_handler = new DatetimeHandler($list_array[$key]['datetime']);
                 $list_array[$key]['datetime'] = $datetime_handler->get_datetime(false);
                 $owner = new User($value['owner']);
                 $list_array[$key]['owner'] = $owner->get_full_name(true);
                 if (is_numeric($value['file_id'])) {
                     $file = File::get_instance($value['file_id']);
                     $paramquery = $_GET;
                     $paramquery['nav'] = "data";
                     $paramquery['action'] = "file_detail";
                     $paramquery['file_id'] = $value['file_id'];
                     unset($paramquery['sortvalue']);
                     unset($paramquery['sortmethod']);
                     unset($paramquery['nextpage']);
                     $params = http_build_query($paramquery, '', '&#38;');
                     $tmp_name = $value['name'];
                     unset($list_array[$key]['name']);
                     $list_array[$key]['name']['content'] = $tmp_name;
                     if ($file->is_read_access() == true) {
                         $list_array[$key]['symbol']['link'] = $params;
                         $list_array[$key]['symbol']['content'] = "<img src='" . File::get_icon_by_name($value['name']) . "' alt='' style='border:0;' />";
                         $list_array[$key]['name']['link'] = $params;
                     } else {
                         $list_array[$key]['symbol']['link'] = "";
                         $list_array[$key]['symbol']['content'] = "<img src='core/images/denied_overlay.php?image=" . File::get_icon_by_name($value['name']) . "' alt='' border='0' />";
                         $list_array[$key]['name']['link'] = "";
                     }
                     $list_array[$key]['type'] = "File";
                     $list_array[$key]['version'] = $file->get_version();
                     $list_array[$key]['size'] = Convert::convert_byte_1024($file->get_size());
                     $list_array[$key]['permission'] = $file->get_permission_string();
                 }
                 if (is_numeric($value['value_id'])) {
                     $value_obj = Value::get_instance($value['value_id']);
                     $paramquery = $_GET;
                     $paramquery['nav'] = "data";
                     $paramquery['action'] = "value_detail";
                     $paramquery['value_id'] = $value['value_id'];
                     unset($paramquery['sortvalue']);
                     unset($paramquery['sortmethod']);
                     unset($paramquery['nextpage']);
                     $params = http_build_query($paramquery, '', '&#38;');
                     $tmp_name = $value['name'];
                     unset($list_array[$key]['name']);
                     $list_array[$key]['name']['content'] = $tmp_name;
                     if ($value_obj->is_read_access() == true) {
                         $list_array[$key]['symbol']['link'] = $params;
                         $list_array[$key]['symbol']['content'] = "<img src='images/fileicons/16/unknown.png' alt='' style='border: 0;'>";
                         $list_array[$key]['name']['link'] = $params;
                     } else {
                         $list_array[$key]['symbol']['link'] = "";
                         $list_array[$key]['symbol']['content'] = "<img src='core/images/denied_overlay.php?image=images/fileicons/16/unknown.png' alt='' border='0' />";
                         $list_array[$key]['name']['link'] = "";
                     }
                     $list_array[$key]['type'] = "Value";
                     $list_array[$key]['version'] = $value_obj->get_version();
                     $list_array[$key]['permission'] = $value_obj->get_permission_string();
                 }
                 if (is_numeric($value['folder_id'])) {
                     $folder = Folder::get_instance($value['folder_id']);
                     $paramquery = $_GET;
                     $paramquery['nav'] = "data";
                     $paramquery['folder_id'] = $value['folder_id'];
                     unset($paramquery['run']);
                     unset($paramquery['sortvalue']);
                     unset($paramquery['sortmethod']);
                     unset($paramquery['nextpage']);
                     $params = http_build_query($paramquery, '', '&#38;');
                     $tmp_name = $value['name'];
                     unset($list_array[$key]['name']);
                     $list_array[$key]['name']['content'] = $tmp_name;
                     if ($folder->is_read_access() == true) {
                         $list_array[$key]['symbol']['link'] = $params;
                         $list_array[$key]['symbol']['content'] = "<img src='images/icons/folder.png' alt='' style='border: 0;'>";
                         $list_array[$key]['name']['link'] = $params;
//.........这里部分代码省略.........
开发者ID:suxinde2009,项目名称:www,代码行数:101,代码来源:data_search.ajax.php

示例13: listen_events

 /**
  * @see EventListenerInterface::listen_events()
  * @param object $event_object
  * @return bool
  */
 public static function listen_events($event_object)
 {
     if ($event_object instanceof ItemUnlinkEvent) {
         if (($data_entity_id = DataEntityIsItem_Access::get_entry_by_item_id($event_object->get_item_id())) != null) {
             if (($file_id = File::get_file_id_by_data_entity_id($data_entity_id)) != null) {
                 $file = File::get_instance($file_id);
                 if ($file->delete() == false) {
                     return false;
                 }
             }
             if (($value_id = Value::get_value_id_by_data_entity_id($data_entity_id)) != null) {
                 $value = Value::get_instance($value_id);
                 if ($value->delete() == false) {
                     return false;
                 }
             }
             if (($parameter_id = Parameter::get_parameter_id_by_data_entity_id($data_entity_id)) != null) {
                 $parameter = Parameter::get_instance($parameter_id);
                 if ($parameter->delete() == false) {
                     return false;
                 }
             }
         }
     }
     if ($event_object instanceof UserDeleteEvent) {
         if (DataEntity_Access::set_owner_id_on_null($event_object->get_user_id()) == false) {
             return true;
         }
     }
     if ($event_object instanceof GroupDeleteEvent) {
         if (DataEntity_Access::set_owner_group_id_on_null($event_object->get_group_id()) == false) {
             return true;
         }
     }
     return true;
 }
开发者ID:suxinde2009,项目名称:www,代码行数:41,代码来源:data_entity.class.php


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