Skip to content

Commit

Permalink
adjust styles and add check for children
Browse files Browse the repository at this point in the history
  • Loading branch information
gregrgay committed Feb 15, 2016
1 parent 84ee363 commit e22dca0
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions home/classes/StructureManager.class.php
Expand Up @@ -192,7 +192,7 @@ function printPreview($flag_button, $structs) {
//echo '<img class="img-size-tree" width="16" height="16" border="0" src="http://localhost/AContentEdu/images/tree/tree_space.gif" alt="">
echo '<img class="img-size-tree" height="16" width="16" border="0" alt="" src="'.TR_BASE_HREF.'images/tree/tree_space.gif"/>';

echo '<p style="display:inline; border-style: solid; border-color: grey; border-width:1px;">'.$this->name.'</p>';
echo '<p style="display:inline;">'.$this->name.'</p>';
//echo '<script type="text/javascript" src="../templates/system/Struct.js"></script>';

echo '<strong>';
Expand Down Expand Up @@ -356,14 +356,14 @@ function getContent($page) {
//die('gC');
if($this->isFolder($page))
return null;




$content = array();
$children = $page->page_templates->children();
foreach ($children as $child) {
$content[] = $child['name'];
// die($child['name']);
if(is_array($children)){
foreach ($children as $child) {
$content[] = $child['name'];
// die($child['name']);
}
}

return $content;
Expand Down Expand Up @@ -421,17 +421,16 @@ function createStruct($page_temp, $id_folder, $course_id) {
$forum_course->Create($forum_id, $course_id);

} else if($this->hasTest($page)) {
//debug($page->tests);

$count = 0;
foreach($page->tests as $test){
global $msg;
$msg->addFeedback($count);
$testsDAO = new TestsDAO();
$test_ass_cont = new ContentTestsAssocDAO();
//debug($test);
$test_id = $testsDAO->Create($course_id, $page['name'].$count, _AT('tests_description'));
$test_ass_cont->Create($content_id, $test_id);
$count++;
global $msg;
$msg->addFeedback($count);
$testsDAO = new TestsDAO();
$test_ass_cont = new ContentTestsAssocDAO();
$test_id = $testsDAO->Create($course_id, $page['name'].$count, _AT('tests_description'));
$test_ass_cont->Create($content_id, $test_id);
$count++;
}

} else if($content_type == 1) {
Expand Down

0 comments on commit e22dca0

Please sign in to comment.