Exemplo n.º 1
0
require "../../global/session_start.php";
ft_check_permission("admin");
_ft_cache_form_stats();
if (isset($_GET["reset"])) {
    $_SESSION["ft"]["form_sort_order"] = "";
    $_SESSION["ft"]["form_search_keyword"] = "";
    $_SESSION["ft"]["form_search_status"] = "";
    $_SESSION["ft"]["form_search_client_id"] = "";
}
$order = ft_load_field("order", "form_sort_order", "form_id-DESC");
$keyword = ft_load_field("keyword", "form_search_keyword", "");
$status = ft_load_field("status", "form_search_status", "");
$client_id = ft_load_field("client_id", "form_search_client_id", "");
$search_criteria = array("order" => $order, "keyword" => $keyword, "status" => $status, "client_id" => $client_id);
$num_forms = ft_get_form_count();
$forms = ft_search_forms($client_id, true, $search_criteria);
$clients = ft_get_client_list();
// ------------------------------------------------------------------------------------------------
// compile template info
$page_vars = array();
$page_vars["page"] = "admin_forms";
$page_vars["page_url"] = ft_get_page_url("admin_forms");
$page_vars["head_title"] = $LANG["word_forms"];
$page_vars["has_client"] = count($clients) > 0 ? true : false;
$page_vars["num_forms"] = $num_forms;
$page_vars["max_forms_reached"] = !empty($g_max_ft_forms) && $num_forms >= $g_max_ft_forms ? true : false;
$page_vars["max_forms"] = $g_max_ft_forms;
$page_vars["notify_max_forms_reached"] = ft_eval_smarty_string($LANG["notify_max_forms_reached"], array("max_forms" => $g_max_ft_forms));
$page_vars["forms"] = $forms;
$page_vars["order"] = $order;
$page_vars["clients"] = $clients;
Exemplo n.º 2
0
/**
 * Basically a wrapper function for ft_search_forms, which returns ALL forms, regardless of
 * what client it belongs to.
 *
 * @return array
 */
function ft_get_forms()
{
    return ft_search_forms($account_id = "", true);
}
Exemplo n.º 3
0
<?php

if (isset($_POST['update_client'])) {
    list($g_success, $g_message) = ft_admin_update_client($request, 2);
}
// if required, update the list of available languages
if (isset($_GET["refresh_lang_list"])) {
    list($g_success, $g_message) = ft_refresh_language_list();
}
$client_info = ft_get_account_info($client_id);
$forms = ft_search_forms($client_id);
$replacement_info = array("datefunctionlink" => '<a href="http://ca3.php.net/manual/en/function.date.php" target="_blank">date()</a>');
// -------------------------------------------------------------------------------------------
// compile header information
$page_vars["page"] = "settings";
$page_vars["page_url"] = ft_get_page_url("edit_client_settings", array("client_id" => $client_id));
$page_vars["head_title"] = "{$LANG["phrase_edit_client"]} - {$LANG["word_settings"]}";
$page_vars["phrase_one_special_char"] = ft_eval_smarty_string($LANG["phrase_one_special_char"], array("chars" => $g_password_special_chars));
$page_vars["client_info"] = $client_info;
$page_vars["forms"] = $forms;
$page_vars["client_id"] = $client_id;
$page_vars["text_date_formatting_link"] = ft_eval_smarty_string($LANG["text_date_formatting_link"], $replacement_info);
$page_vars["head_js"] = <<<END
var rules = [];
rules.push("required,page_titles,{$LANG["validation_no_titles"]}");
rules.push("required,menu_id,{$LANG["validation_no_menu"]}");
rules.push("required,theme,{$LANG["validation_no_theme"]}");
rules.push("function,validate_swatch");
rules.push("required,login_page,{$LANG["validation_no_client_login_page"]}");
rules.push("required,logout_url,{$LANG["validation_no_logout_url"]}");
rules.push("required,ui_language,{$LANG["validation_no_ui_language"]}");
Exemplo n.º 4
0
<?php

require_once "../global/session_start.php";
ft_check_permission("client");
_ft_cache_form_stats();
$account_id = $_SESSION["ft"]["account"]["account_id"];
if (isset($_GET["reset"])) {
    $_SESSION["ft"]["form_sort_order"] = "";
    $_SESSION["ft"]["form_search_keyword"] = "";
}
$order = ft_load_field("order", "form_sort_order", "form_name-ASC");
$keyword = ft_load_field("keyword", "form_search_keyword", "");
$search_criteria = array("order" => $order, "keyword" => $keyword);
$num_client_forms = count(ft_get_client_forms($account_id));
$forms = ft_search_forms($account_id, false, $search_criteria);
$client_info = ft_get_account_info($account_id);
$forms_page_default_message = ft_eval_smarty_string($client_info["settings"]["forms_page_default_message"]);
// ------------------------------------------------------------------------------------------
// compile header information
$page_vars = array();
$page_vars["head_title"] = ft_eval_smarty_string($_SESSION["ft"]["account"]["settings"]["page_titles"], array("page" => $LANG["word_forms"]));
$page_vars["page"] = "client_forms";
$page_vars["page_url"] = ft_get_page_url("client_forms");
$page_vars["num_client_forms"] = $num_client_forms;
$page_vars["forms"] = $forms;
$page_vars["forms_page_default_message"] = $forms_page_default_message;
$page_vars["search_criteria"] = $search_criteria;
$page_vars["js_messages"] = array("phrase_open_form_in_new_tab_or_win", "word_close", "phrase_show_form");
$page_vars["head_js"] = <<<END
\$(function() { ft.init_show_form_links(); });
END;
Exemplo n.º 5
0
/**
 * This returns all forms and form Views that a client account may access.
 *
 * @param array $account_id
 */
function ft_get_client_form_views($account_id)
{
    $client_forms = ft_search_forms($account_id);
    $info = array();
    foreach ($client_forms as $form_info) {
        $form_id = $form_info["form_id"];
        $views = ft_get_form_views($form_id, $account_id);
        $view_ids = array();
        foreach ($views as $view_info) {
            $view_ids[] = $view_info["view_id"];
        }
        $info[$form_id] = $view_ids;
    }
    extract(ft_process_hook_calls("end", compact("account_id", "info"), array("info")), EXTR_OVERWRITE);
    return $info;
}
Exemplo n.º 6
0
        $view_id = $form_view["view_id"];
        $view_name = htmlspecialchars($form_view["view_name"]);
        $v[] = "[{$view_id}, \"{$view_name}\"]";
    }
    $views = implode(",", $v);
    $form_views_js_info[] = "page_ns.form_views.push([{$form_id},[{$views}]])";
}
$forms_js = implode(";\n", $forms_js_rows);
$form_views_js = implode(";\n", $form_views_js_info);
// loop through each form and add all the Views
$all_form_views = array();
foreach ($forms as $form_info) {
    $form_id = $form_info["form_id"];
    $all_form_views[$form_id] = ft_get_form_views($form_id);
}
$client_forms = ft_search_forms($client_id, true);
$updated_client_forms = array();
foreach ($client_forms as $form_info) {
    $form_id = $form_info["form_id"];
    $form_info["views"] = ft_get_form_views($form_id, $client_id);
    $updated_client_forms[] = $form_info;
}
// -------------------------------------------------------------------------------------------
// compile header information
$page_vars["page"] = "forms";
$page_vars["page_url"] = ft_get_page_url("edit_client_forms", array("client_id" => $client_id));
$page_vars["head_title"] = "{$LANG["phrase_edit_client"]} - {$LANG["word_forms"]}";
$page_vars["client_info"] = $client_info;
$page_vars["forms"] = $forms;
$page_vars["client_forms"] = $updated_client_forms;
$page_vars["all_form_views"] = $all_form_views;