Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
flv_file_edit_fns.inc
1 <?php
18 require_once SQ_CORE_PACKAGE_PATH.'/files/file/file_edit_fns.inc';
19 
32 {
33 
34 
39  function __construct()
40  {
41  parent::__construct();
42  $this->static_screens['details']['force_unlock'] = 1;
43 
44  }//end constructor
45 
46 
68  function processFileUpload(&$asset, &$o, $prefix, $info=Array(), $redirect_in_limbo=TRUE, $asset_cloned=FALSE)
69  {
70  if (!parent::processFileUpload($asset, $o, $prefix, $info, $redirect_in_limbo, $asset_cloned)) {
71  return FALSE;
72  }
73 
74  //assetid will not be set if we are creating a new asset
75  //otherwise, tell the FLV asset that we want to get its basic metadata and store them in its attributes
76  if (!empty($asset->id)) {
77  $asset->setAttrValue('extract_metadata', TRUE);
78  }
79 
80  return TRUE;
81 
82  }// end processFileUpload()
83 
84 
94  function paintExtractMetadata(FLV_File $asset, Backend_Outputter $o, $prefix)
95  {
96  $write_access = $asset->writeAccess('attributes');
97 
98  if ($write_access) {
99  check_box($prefix.'_extract_metadata', 1, FALSE);
100  } else {
101  ?><em>Acquire Lock(s) on the asset to access this option</em><?php
102  }
103 
104  // Check to see if getID3() is enabled
105  if (!SQ_TOOL_GETID3_ENABLED) {
106  ?><br/><span class="sq-backend-warning">The getID3() tool is not currently enabled</span><?php
107  } else if (!is_file(SQ_TOOL_GETID3_PATH.'/getid3.php')) {
108  ?><br/><span class="sq-backend-warning">The path to getID3() tool is invalid</span><?php
109  }
110 
111  return $write_access;
112 
113  }// end paintExtractMetadata()
114 
115 
127  public function processExtractMetadata(FLV_File $asset, Backend_Outputter $o, $prefix)
128  {
129  if (!$asset->writeAccess('attributes')) return FALSE;
130  $extract = array_get_index($_POST, $prefix.'_extract_metadata', FALSE);
131 
132  if ($extract) {
133  //tell the FLV asset that it needs to extract basic metadata and store them in its attributes
134  $asset->setAttrValue('extract_metadata', TRUE);
135  }
136 
137  return TRUE;
138 
139  }// end processExtractMetadata()
140 
141 
142 }//end class
143 
144 ?>