<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>JWPlayer test</title>
<script src="player/jwplayer.js"></script>
</head>
<body>
<?php
$dir = 'video';
$files = scandir($dir,1);
echo '<pre>';var_dump($files);
for($i=0, $cnt = count($files);$i<$cnt;$i++)
{
if (substr($files[$i], -3) == 'flv' )
{
$id = $files[$i];
echo "
<div id='$id'></div>
<script type='text/javascript'>
jwplayer('$id').setup({
file: 'video/$id',
title: 'Razer',
width: '100%',
aspectratio: '16:9',
fallback: 'false'
});
</script>
";
}
}
?>
</body>
</html>
$a = Page::model()->findAll();
foreach ($a as $user)
{
$all[$user->p_parent][] = array(id => $user->p_id, text=> $user->p_title, parent_id => $user->p_parent);
}
function RecursiveTree2(&$rs, $parent)
{
$out = array();
if (!isset($rs[$parent]))
{
return $out;
}
foreach ($rs[$parent] as $row)
{
$chidls = RecursiveTree2($rs, $row['id']);
if ($chidls)
{
$row['expanded'] = false;
$row['children'] = $chidls;
}
$out[] = $row;
}
return $out;
}
$this->widget('CTreeView', array('data' => RecursiveTree2($all ,0), 'htmlOptions' => array('class' => 'treeview-red')));
array(7) {
[2]=>
array(2) {
[0]=>
array(3) {
["id"]=>
int(3)
["text"]=>
string(1) "3"
["parent_id"]=>
int(2)
}
[1]=>
array(3) {
["id"]=>
int(8)
["text"]=>
string(5) "22222"
["parent_id"]=>
int(2)
}
}
<?
if (!isset($_SESSION['act'])) $_SESSION['act'] = 0;
if(isset($_POST['ses']))
{
if ($_SESSION['act'] == 1) $_SESSION['act'] =0;
else $_SESSION['act'] =1;
}
?>
<form id="newFormAdv" method="post">
<input type="submit" name="ses" id="some_element" value="Сохранить"
onclick="document.getElementById('newFormAdv').submit()">
</form>
<script>
function init()
{
var val = '<?php echo $_SESSION['act']; ?>';
if (val == 1) {
newFormAdv.ses.click();
document.getElementById('Module15.HskL').innerHTML = 'сохранено';
}
}
window.onload = init;
</script>