예제 #1
0
파일: index.php 프로젝트: alerque/bibledit
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
require_once "../bootstrap/bootstrap.php";
page_access_level(Filter_Roles::TRANSLATOR_LEVEL);
$header = new Assets_Header(Locale_Translate::_("Consistency"));
$header->run();
$database_config_user = Database_Config_User::getInstance();
$database_bibles = Database_Bibles::getInstance();
$database_usfmresources = Database_UsfmResources::getInstance();
$ipc_focus = Ipc_Focus::getInstance();
@($add = $_GET['add']);
if (isset($add)) {
    if ($add == "") {
        $dialog_list = new Dialog_List2(Locale_Translate::_("Would you like to add a Resource?"));
        $resources = Resource_Logic::getNames();
        foreach ($resources as $resource) {
            $dialog_list->add_row($resource, "&add={$resource}");
        }
        $dialog_list->run();
    } else {
        $resources = $database_config_user->getConsistencyResources();
        $resources[] = $add;
        $resources = array_unique($resources, SORT_STRING);
        $database_config_user->setConsistencyResources($resources);
    }
}
@($remove = $_GET['remove']);
if (isset($remove)) {
    $resources = $database_config_user->getConsistencyResources();
    $resources = array_diff($resources, array($remove));
예제 #2
0
$database_config_user = Database_Config_User::getInstance();
@($add = $_GET['add']);
if (isset($add)) {
    $resources = $database_config_user->getActiveResources();
    $resources[] = $add;
    $database_config_user->setActiveResources($resources);
}
@($remove = $_GET['remove']);
if (isset($remove)) {
    $resources = $database_config_user->getActiveResources();
    $key = array_search($remove, $resources);
    unset($resources[$key]);
    $database_config_user->setActiveResources($resources);
}
@($resources = $_POST['resources']);
if (isset($resources)) {
    $resources = explode(",", $resources);
    $database_config_user->setActiveResources($resources);
}
$header = new Assets_Header(Locale_Translate::_("Resources"));
$header->jQueryUIOn("sortable");
$header->run();
$view = new Assets_View(__FILE__);
$active_resources = $database_config_user->getActiveResources();
$view->view->actives = $active_resources;
// The selectable resources are the available ones minus the active ones.
$available_resources = Resource_Logic::getNames();
$selectable_resources = array_diff($available_resources, $active_resources);
$view->view->selectables = $selectable_resources;
$view->render("organize.php");
Assets_Page::footer();