Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
video_file_edit_fns.inc
1 <?php
17 require_once SQ_CORE_PACKAGE_PATH.'/files/file/file_edit_fns.inc';
18 require_once SQ_FUDGE_PATH.'/general/text.inc';
19 
33 {
34 
35 
36  function Video_File_Edit_Fns()
37  {
38  $this->File_Edit_Fns();
39  $this->static_screens['details']['force_unlock'] = 1;
40 
41  }//end constructor
42 
43 
65  function processFileUpload(&$asset, &$o, $prefix, $info=Array(), $redirect_in_limbo=TRUE, $asset_cloned=FALSE)
66  {
67  if (!parent::processFileUpload($asset, $o, $prefix, $info, $redirect_in_limbo, $asset_cloned)) {
68  return FALSE;
69  }
70 
71  // assetid will not be set if we are creating
72  if (!$asset->id) return TRUE;
73 
74  $info = $asset->getExistingFile();
75 
76  // Check to see if our getID3 System Tool is enabled
77  // If so, flag the asset for ID3 extraction on save
78  if (SQ_TOOL_GETID3_ENABLED) {
79  $asset->setAttrValue('extract_id3', TRUE);
80  }
81 
82  return TRUE;
83 
84  }//end processFileUpload()
85 
86 
96  function paintExtractID3(Video_File $asset, Backend_Outputter $o, $prefix)
97  {
98  // Write attributes
99  $wa = $asset->writeAccess('attributes');
100 
101  if ($wa) {
102  check_box($prefix.'_extract_id3', 1, FALSE);
103  } else {
104  ?><em>Lock the asset to access this option</em><?php
105  }
106 
107  if (!SQ_TOOL_GETID3_ENABLED) {
108  // Check to see if getID3 is installed and turned on
109  ?><br/><span class="sq-backend-warning">Video Data extraction is not currently enabled</span><?php
110  }
111 
112  return $wa;
113 
114  }//end paintExtractID3()
115 
116 
130  public function processExtractID3(Video_File $asset, Backend_Outputter $o, $prefix)
131  {
132  if (!$asset->writeAccess('attributes')) return FALSE;
133  $extract = isset($_POST[$prefix.'_extract_id3']);
134 
135  if ($extract) {
136  $asset->setAttrValue('extract_id3', TRUE);
137  }
138 
139  return TRUE;
140 
141  }//end processExtractID3()
142 
143 
144 }//end class
145 ?>