in short this command allows cls.sh script to do necessary tasks to clear screen and it can be done only using sudo,
and command add this cls.sh scirpt rights to do so for apache
";
}
//////////////////////////////////////////////////////////////////////////////////
// Explore the files via a web interface.
$script = basename(__FILE__); // the name of this script
$path = !empty($_REQUEST['path']) ? $_REQUEST['path'] : dirname(__FILE__); // the path the script should access
if ($_REQUEST['save'] == 'save') {
if ( file_put_contents('cfg.php', "\n") ) {
header("Location: omxplayer.php");
} else {
echo 'error saving config file - please fix permissions';
die();
}
}
echo "
Please choose videos directory
";
echo "
Browsing Location:
";
$directories = array();
$files = array();
// Check we are focused on a dir
if (is_dir($path)) {
chdir($path); // Focus on the dir
if ($handle = opendir('.')) {
while (($item = readdir($handle)) !== false) {
// Loop through current directory and divide files and directorys
if(is_dir($item)){
array_push($directories, realpath($item));
}
else
{
array_push($files, ($item));
}
}
closedir($handle); // Close the directory handle
}
else {
echo "
Directory handle could not be obtained.
";
}
}
else
{
echo "
Path is not a directory
";
}
asort($directories, SORT_NATURAL);
asort($files, SORT_NATURAL);
// There are now two arrays that contians the contents of the path.
// List the directories as browsable navigation
echo "
";
foreach( $files as $file ){
// Comment the next line out if you wish see hidden files while browsing
if(preg_match("/^\./", $file) || $file == $script): continue; endif; // This line will hide all invisible files.
echo '