Пример #1
0
 public function testAddApplication()
 {
     //Test Add any app
     add_app('Frontend');
     $paths = get_app()->getTwigLoader()->getPaths();
     $this->assertEquals(2, count($paths), 'Must be 2 paths in twigs paths');
     $this->assertEquals($paths[1], APPS_DIR . '/Frontend/Views');
     //Reseting twitgs, leaving only towel twig
     get_app()->getTwigLoader()->setPaths(array($paths[0]));
     //Adding frontend as default
     add_app('Frontend', true);
     $paths2 = get_app()->getTwigLoader()->getPaths();
     $this->assertEquals(2, count($paths2), 'Must be 2 paths in twigs paths');
     $this->assertEquals($paths2[0], APPS_DIR . '/Frontend/Views', 'Frontend must be first');
     $this->assertEquals($paths2[1], APP_ROOT_DIR . '/vendor/42mate/towel/src/Towel/Views', 'Towel twigs must be in the 2 item');
 }
Пример #2
0
            $v = ' CHECKED ';
        }
        echo "  <TD align='center'>\n            <input name='beta' type='checkbox' {$v}></TD>\n        ";
        $v = '';
        if ($app->fraction_done_exact) {
            $v = ' CHECKED ';
        }
        echo "  <TD align='center'>\n            <input name='fraction_done_exact' type='checkbox' {$v}></TD>\n        ";
        echo "<td><input class=\"btn btn-default\" type=submit name=submit value=Update>";
        echo "</tr></form>";
    }
    end_table();
    // Entry form to create a new application
    //
    echo "<P>\n        <h2>Add an application</h2>\n        To add an application enter the short name and description\n        ('user friendly name') below.  You can then edit the\n        application when it appears in the table above.\n        <p>\n        <form action=manage_apps.php method=POST>\n    ";
    start_table("align='center' ");
    table_header("Name", "Description", "&nbsp;");
    echo "<TR>\n            <TD> <input type='text' size='12' name='add_name' value=''></TD>\n            <TD> <input type='text' size='35' name='add_user_friendly_name' value=''></TD>\n            <TD align='center' >\n                 <input type='submit' name='add_app' value='Add Application'></TD>\n            </TR>\n";
    end_table();
    echo "</form><p>\n";
}
admin_page_head("Manage applications");
if (post_str('add_app', true)) {
    add_app();
} else {
    if (post_str('submit', true)) {
        do_updates();
    }
}
show_form(false);
admin_page_tail();