original_string: public function instance_copy($fromid) {
          $fromcontext = context_block::instance($fromid);
          $fs = get_file_storage();
          // This extra check if file area is empty adds one query if it is not empty but saves several if it is.
          if (!$fs->is_area_empty($fromcontext->id, 'block_html', 'content', 0, false)) {
              $draftitemid = 0;
              file_prepare_draft_area($draftitemid, $fromcontext->id, 'block_html', 'content', 0, array('subdirs' => true));
              file_save_draft_area_files($draftitemid, $this->context->id, 'block_html', 'content', 0, array('subdirs' => true));
          }
          return true;
      }
code: public function instance_copy($fromid) {
          $fromcontext = context_block::instance($fromid);
          $fs = get_file_storage();
          // This extra check if file area is empty adds one query if it is not empty but saves several if it is.
          if (!$fs->is_area_empty($fromcontext->id, 'block_html', 'content', 0, false)) {
              $draftitemid = 0;
              file_prepare_draft_area($draftitemid, $fromcontext->id, 'block_html', 'content', 0, array('subdirs' => true));
              file_save_draft_area_files($draftitemid, $this->context->id, 'block_html', 'content', 0, array('subdirs' => true));
          }
          return true;
      }
code_tokens: public function instance_copy ( $ fromid ) { $ fromcontext = context_block :: instance ( $ fromid ) ; $ fs = get_file_storage ( ) ; // This extra check if file area is empty adds one query if it is not empty but saves several if it is. if ( ! $ fs -> is_area_empty ( $ fromcontext -> id , 'block_html' , 'content' , 0 , false ) ) { $ draftitemid = 0 ; file_prepare_draft_area ( $ draftitemid , $ fromcontext -> id , 'block_html' , 'content' , 0 , array ( 'subdirs' => true ) ) ; file_save_draft_area_files ( $ draftitemid , $ this -> context -> id , 'block_html' , 'content' , 0 , array ( 'subdirs' => true ) ) ; } return true ; }
docstring: Copy any block-specific data when copying to a new block instance.
  @param int $fromid the id number of the block instance to copy from
  @return boolean
docstring_tokens: Copy any block - specific data when copying to a new block instance .