예제 #1
0
function pCell($item, $var, $format, $size = "", $nohelp = "")
{
    $var = stripslashes($var);
    $out = tda(gTxt($item), ' style="text-align:right;vertical-align:middle"');
    switch ($format) {
        case "radio":
            $in = yesnoradio($item, $var);
            break;
        case "input":
            $in = text_input($item, $var, $size);
            break;
        case "timeoffset":
            $in = timeoffset_select($item, $var);
            break;
        case 'commentmode':
            $in = commentmode($item, $var);
            break;
        case 'cases':
            $in = cases($item, $var);
            break;
        case 'dateformats':
            $in = dateformats($item, $var);
            break;
        case 'weeks':
            $in = weeks($item, $var);
            break;
        case 'logging':
            $in = logging($item, $var);
            break;
        case 'languages':
            $in = languages($item, $var);
            break;
        case 'text':
            $in = text($item, $var);
            break;
        case 'urlmodes':
            $in = urlmodes($item, $var);
    }
    $out .= td($in);
    $out .= $nohelp != 1 ? tda(popHelp($item), ' style="vertical-align:middle"') : td();
    return tr($out);
}
function rss_admin_editlink($event, $step)
{
    global $rss_ae_cookie;
    include txpath . '/include/txp_prefs.php';
    if (!isset($rss_ae_cookie)) {
        $rss_ae_cookie = "rss_article_edit";
        $rs = safe_insert('txp_prefs', "name='rss_ae_cookie', val='{$rss_ae_cookie}', prefs_id='1'");
    }
    if (gps("add")) {
        safe_update("txp_prefs", "val = '" . addslashes(ps('rss_ae_cookie')) . "'", "name = 'rss_ae_cookie' and prefs_id ='1'");
        setcookie($rss_ae_cookie, $rss_ae_cookie, time() + 31536000, "/");
        header("Location: index.php?event=editlink");
    } else {
        if (gps("rem")) {
            safe_update("txp_prefs", "val = '" . addslashes(ps('rss_ae_cookie')) . "'", "name = 'rss_ae_cookie' and prefs_id ='1'");
            setcookie($rss_ae_cookie, $rss_ae_cookie, time() - 3600, "/");
            header("Location: index.php?event=editlink");
        }
    }
    pagetop("Edit Link");
    $aeset = isset($_COOKIE[$rss_ae_cookie]) ? "" : " not";
    $tdaStyle = ' style="text-align:right;vertical-align:middle"';
    echo form(startTable("list") . tr(tdcs(hed("Add/Remove Public Site Article Edit Link", 1), 2)) . tr(tda(graf('Cookie ' . $rss_ae_cookie . ' is' . $aeset . ' set.', ' align="center"'), ' colspan="2"')) . tr(tda(gTxt('Cookie Name:'), ' style="text-align:right;vertical-align:middle"') . tda(text_input("rss_ae_cookie", $rss_ae_cookie, '20'), ' ')) . tr(tda(graf(fInput("submit", "add", gTxt("Add Edit Link"), "publish") . fInput("submit", "rem", gTxt("Remove Edit Link"), "publish") . eInput("editlink"), ' align="center"'), ' colspan="2"')) . endTable());
}
예제 #3
0
            insert_db('Caranille_Chat', array('Chat_Pseudo_ID' => $ID, 'Chat_Guild_ID' => $guild_ID, 'Chat_Message' => $Message));
            // }
        }
        if (verif_access("Admin", true)) {
            if (request_confirm('Chat-Clear')) {
                //if(verifier_token(600, get_link('Chat','Guild') ,  'guild-Chat-Send'))
                //{
                delete_db('Caranille_Chat', array('Chat_Guild_ID' => guild_data('Guild_ID')));
                echo 'Tous les messages ont bien été supprimé';
                //}
            }
        }
        echo "<div id='guild-chat'>";
        echo LanguageValidation::iMsg("intro.guild.chat");
        echo '<br />';
        echo '<iframe class="chatroom-frame" src="' . get_link('guild', 'Chat') . '"></iframe>';
        echo formulaire_input(array(text_input("label.chat.message", "chat_Message", null, null, null, "placeholder.chat.message"), submit_input("Chat-Send", "btn.chat.send"), verif_access("Admin", true) ? submit_input("Chat-Clear", "btn.chat.clear") : null), "guild-Chat-Send", null, "post", null);
        /**			
        			echo '<form method="POST" action="'.get_link("Chat","Guild").'">';
        			echo '<input type="text" name="chat_Message" placeholder="'.LanguageValidation::nMsg("placeholder.chat.message").'"/>'.LanguageValidation::eMsg("placeholder.chat.message");
        			echo '<input type="submit" name="Chat-Send" value="'.LanguageValidation::nMsg("btn.chat.send").'"/>'.LanguageValidation::eMsg("btn.chat.send");
        		
        			if(verif_access("Admin",true))
        				echo '<input type="submit" name="Clear" value="'.LanguageValidation::nMsg("btn.chat.clear").'"/>'.LanguageValidation::eMsg("btn.chat.clear");
        				
        			echo '<input type="hidden" name="token" value="'.generer_token('guild-Chat-Send').'" />';
        			echo '</form>';				
        **/
        echo "</div>";
    }
}
예제 #4
0
파일: index.php 프로젝트: nikosv/openeclass
        $helpdeskmail = '';
    }    
    $tool_content .= "
       <form class='form-horizontal' role='form' action='$_SERVER[SCRIPT_NAME]' method='post'>
         <fieldset>" .
           form_entry('urlForm', text_input('urlForm', 40), "$langSiteUrl (*)") .
           form_entry('nameForm', text_input('nameForm', 40), "$langAdminName (*)") .
           form_entry('emailForm', text_input('emailForm', 40), "$langAdminEmail (*)") .
           form_entry('loginForm', text_input('loginForm', 40), "$langAdminLogin (*)") .
           form_entry('passForm', text_input('passForm', 40), "$langAdminPass (*)") .
           form_entry('campusForm', text_input('campusForm', 40), $langCampusName) .
           form_entry('helpdeskForm', text_input('helpdeskForm', 40), $langHelpDeskPhone) .
           form_entry('faxForm', text_input('faxForm', 40), $langHelpDeskFax) .
           form_entry('helpdeskmail', text_input('helpdeskmail', 40), "$langHelpDeskEmail (**)") .
           form_entry('institutionForm', text_input('institutionForm', 40), $langInstituteShortName) .
           form_entry('institutionUrlForm', text_input('institutionUrlForm', 40), $langInstituteName) .
           form_entry('postaddressForm', textarea_input('postaddressForm', 3, 40), $langInstitutePostAddress) .
           form_entry('eclass_stud_reg',
                      selection_input(array('2' => $langDisableEclassStudRegType,
                                            '1' => $langReqRegUser,
                                            '0' => $langDisableEclassStudReg),
                                      'eclass_stud_reg'),
                      "$langUserAccount $langViaeClass") .
           form_entry('eclass_prof_reg',
                      selection_input(array('1' => $langReqRegProf,
                                            '0' => $langDisableEclassProfReg),
                                      'eclass_prof_reg'), 
                      "$langProfAccount $langViaeClass") . "
           <div class='form-group'>
             <input type='submit' class='btn btn-default' name='install3' value='&laquo; $langPreviousStep'>
		     <input type='submit' class='btn btn-primary' name='install5' value='$langNextStep &raquo;'>
예제 #5
0
}
?>
<form role="form" method="post" name="pathfinder-form" id="pathfinder-form" action="<?php 
echo site_url('/taxonomy/save/' . $type);
?>
">
<?php 
echo create_bootstrap_input('text', 'name', array(), 'Term Name', '', '', isset($record->name) ? $record->name : '', '', 'Name of term', true);
echo create_bootstrap_input('text', 'description', array(), 'Description', '', '', isset($record->description) ? $record->description : '', '', 'Description/qualifier of term');
$weight_options = array();
for ($i = -50; $i < 51; $i++) {
    $weight_options[$i] = $i;
}
echo create_bootstrap_input('select', 'weight', $weight_options, 'Weight', '', '', isset($record->weight) ? $record->weight : '', 'style="width: 75px;"', 'Weight for term');
?>
<input type="hidden" name="type" value="<?php 
echo $type;
?>
" />
<?php 
if (isset($update_ID)) {
    echo text_input('hidden', 'update_ID', '', '', $update_ID);
    echo text_input('button', 'cancel', 'btn btn-warning', '', 'Cancel', 'onclick="javascript: history.back()"');
    echo '&nbsp;';
}
echo text_input('submit', 'save', 'btn btn-primary', '', 'Save Term');
?>
</form>
<?php 
$main_content = ob_get_clean();
require './assets/themes/default/index.tpl.php';
    $given = $row['given'];
    $patronym = $row['patronym'];
    $toponym = $row['toponym'];
    $surname = $row['surname'];
    $occupation = $row['occupation'];
    $epithet = $row['epithet'];
    form_begin('person_insert', $_SERVER['PHP_SELF']);
    hidden_input('posted', 1);
    hidden_input('person', $person);
    radio_gender($gender);
    text_input("{$_Given}:", 50, 'given', $given);
    text_input("{$_Patronym}:", 50, 'patronym', $patronym);
    text_input("{$_Toponym}:", 50, 'toponym', $toponym);
    text_input("{$_Surname}:", 50, 'surname', $surname);
    text_input("{$_Occupation}:", 50, 'occupation', $occupation);
    text_input("{$_Epithet}:", 50, 'epithet', $epithet);
    form_submit();
    form_end();
    echo "</body>\n</html>\n";
} else {
    $person = $_POST['person'];
    $gender = $_POST['gender'];
    $given = $_POST['given'];
    $patronym = $_POST['patronym'];
    $toponym = $_POST['toponym'];
    $surname = $_POST['surname'];
    $occupation = $_POST['occupation'];
    $epithet = $_POST['epithet'];
    pg_query("\n        UPDATE\n            persons\n        SET\n            last_edit = NOW(),\n            gender = {$gender},\n            given = '{$given}',\n            patronym = '{$patronym}',\n            toponym = '{$toponym}',\n            surname = '{$surname}',\n            occupation = '{$occupation}',\n            epithet = '{$epithet}'\n        WHERE\n            person_id = {$person}\n    ");
    header("Location: {$app_root}/family.php?person={$person}");
}
예제 #7
0
    echo "<h2>{$title}</h2>\n";
    $rec = fetch_row_assoc("SELECT tag_fk, place_fk, event_date, date2text(sort_date) AS sd, event_note\n                            FROM events WHERE event_id = {$event}");
    $note = note_from_db($rec['event_note']);
    $notelen = strlen($note);
    $notelen < 1000 ? $note_height = 5 : ($note_height = 20);
    $note_width = 100;
    form_begin('edit_event', $_SERVER['PHP_SELF']);
    hidden_input('person', $person);
    hidden_input('event', $event);
    hidden_input('posted', 1);
    select_tag($rec['tag_fk'], $person, $event);
    select_place($rec['place_fk']);
    date_input($rec['event_date'], $rec['sd']);
    textarea_input("{$_Text}:<br />{$notelen}", $note_height, $note_width, 'event_note', $note);
    source_input();
    text_input("{$_Age}:", 10, 'age', '', "({$_Adds_birth_event})");
    form_submit();
    form_end();
    echo "<h3>{$_Citations}</h3>\n";
    $handle = pg_query("SELECT source_fk FROM event_citations WHERE event_fk = {$event}");
    while ($row = pg_fetch_row($handle)) {
        echo '<p>' . $row[0] . ' ';
        echo fetch_val("SELECT get_source_text({$row['0']})");
        echo "</p>\n";
    }
    echo "</body>\n</html>\n";
} else {
    // do action
    $src = $_POST['source_id'];
    $txt = $_POST['source_text'];
    if ($txt && fetch_val("SELECT is_leaf({$src})") == 't') {
예제 #8
0
 function gbp_array_text($step, $value, $item = '')
 {
     switch (strtolower($step)) {
         default:
         case 'ui_in':
             if (!is_array($value)) {
                 $value = array($value);
             }
             return text_input($item, implode(',', $value), 50);
             break;
         case 'ui_out':
             return explode(',', $value);
             break;
         case 'db_set':
             return implode(',', $value);
             break;
         case 'db_get':
             return explode(',', $value);
             break;
     }
     return '';
 }
예제 #9
0
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 *
 */
$site_name_data = $this->Pathfinder_model->getConfig('site_name');
$contact_data = $this->Pathfinder_model->getConfig('content.contact');
$homepage_data = $this->Pathfinder_model->getConfig('content.homepage');
ob_start();
?>
<form role="form" method="post" name="pathfinder-form" id="pathfinder-form" action="<?php 
echo site_url('/pathfinder/config/save');
?>
">
<?php 
echo create_bootstrap_input('text', 'site_name', array(), 'Site name', '', '', isset($site_name_data['site_name']) ? $site_name_data['site_name'] : '', '', 'Name of this pathfinder site');
echo create_bootstrap_input('textarea', 'contact', array(), 'Contact Information', '', '', isset($contact_data['content.contact']['content']) ? $contact_data['content.contact']['content'] : '', '', 'Library/Librarian contact information');
echo create_bootstrap_input('textarea', 'homepage', array(), 'Homepage Information', '', '', isset($homepage_data['content.homepage']['content']) ? $homepage_data['content.homepage']['content'] : '', '', 'Information that appears on the homepage');
echo text_input('submit', 'save', 'btn btn-primary', '', 'Save Configuration');
?>
</form>
<?php 
$main_content = ob_get_clean();
require './assets/themes/default/index.tpl.php';
예제 #10
0
<?php

if (verif_connect()) {
    echo LanguageValidation::iMsg("intro.public.chat");
    ?>
		
		<!--// chat_content -->
		<iframe class="chatroom-frame" src="<?php 
    echo get_link('list', 'Chat');
    ?>
"></iframe>
<?php 
    echo formulaire_input(array(text_input("label.chat.message", "Message", null, null, null, "placeholder.chat.message"), submit_input("Send", "btn.chat.send"), verif_access("Admin", true) ? submit_input("Clear", "btn.chat.clear") : null), "Chat-Send", get_link('Chat', 'User'), "post", null);
}
예제 #11
0
        $tag_group = $tag_row['tag_group_fk'];
        $tag_name = $tag_row['tag_name'];
        $gedcom_tag = $tag_row['gedcom_tag'];
        $tag_label = $tag_row['tag_label'];
        $tag_type = $tag_row['tag_type_fk'];
    }
    require "./form_header.php";
    echo "<h2>{$title}</h2>\n";
    form_begin('tag_edit', $_SERVER['PHP_SELF']);
    hidden_input('posted', 1);
    hidden_input('tag', $tag);
    select_tag_group($tag_group);
    select_tag_type($tag_type);
    text_input("GEDCOM :", 10, 'gedcom_tag', $gedcom_tag);
    text_input("Tag name :", 80, 'tag_name', $tag_name);
    text_input("Tag label:", 80, 'tag_label', $tag_label);
    form_submit();
    form_end();
    echo "</body>\n</html>\n";
} else {
    $tag = $_POST['tag'];
    $tag_group = $_POST['tag_group'];
    $tag_name = $_POST['tag_name'];
    $gedcom_tag = $_POST['gedcom_tag'];
    $tag_label = $_POST['tag_label'];
    $tag_type = $_POST['tag_type'];
    if (!$tag) {
        // insert new tag
        pg_query("BEGIN");
        $tag = get_next('tag');
        pg_query("\n            INSERT INTO tags (\n                tag_id,\n                tag_group_fk,\n                tag_type_fk,\n                tag_name,\n                gedcom_tag,\n                tag_label\n            )\n            VALUES (\n                {$tag},\n                {$tag_group},\n                {$tag_type},\n                '{$tag_name}',\n                '{$gedcom_tag}',\n                '{$tag_label}'\n            )\n        ");
예제 #12
0
<?php

if (empty($_POST['Delete']) && empty($_POST['Second_Delete'])) {
    echo '<div id="login">';
    /**
    		echo '<form method="POST" action="'.get_link('Delete_Account','User').'"><br />';
    		echo '<label for="Pseudo">Pseudo</label><input placeholder="Pseudo" type="text" name="Pseudo"><br /><br />';
    		echo '<label for="Password">Password</label><input placeholder="Mot de passe" type="password" name="Password"><br /><br />';
    		echo '<input type="submit" name="Second_Delete" value="Suppression">';
    	    echo '<input type="hidden" name="token" value="'.generer_token("Delete_Account-step-1").'"/>';
    		echo '</form>';
    		
    			**/
    echo formulaire_input(array(text_input("label.login.pseudo", "Pseudo", null, null, null, "placeholder.login.pseudo"), password_input("label.login.password", "Password", null, null, null, "placeholder.login.password"), submit_input("Second_Delete", "btn.delete.account")), "Delete_Account-step-1", get_link('Delete', 'User'), "post", null);
    echo '</div>';
}
if (request_confirm('Second_Delete')) {
    //	$Pseudo = htmlspecialchars(addslashes($_POST['Pseudo']));
    //	$Password = md5(htmlspecialchars(addslashes($_POST['Password'])));
    if (verifier_token(600, get_link('Delete_Account'), 'Delete_Account-step-1')) {
        extract(addslashes_r($_POST));
        echo "Sans Regret ?<br />";
        /**	echo '<form method="POST" action="'.get_link('Delete','User').'">';
        			echo '<input type="hidden" name="Pseudo" value="'.$Pseudo.'"/>';
        			echo '<input type="hidden" name="Password" value="'.$Password.'"/>';
        			echo '<input type="submit" name="Back" value="Renoncer">';
        			echo '<input type="hidden" name="token" value="'.generer_token("Delete_Account-step-2").'"/>';
        			echo '<input type="submit" name="Delete" value="Suppression">';
        			echo '</form>';
        		**/
        echo formulaire_input(array(hidden_input("Pseudo", $Pseudo), hidden_input("Password", $Password), submit_input("Back", "btn.back.account"), submit_input("Delete", "btn.delete.account")), "Delete_Account-step-2", get_link('Delete', 'User'), "post", null);
예제 #13
0
function create_bootstrap_input2($type = 'text', $name, $options = array(), $label = '&nbsp;', $classes = '', $state = '', $default_value = '', $additional_attributes, $help = '', $required = false)
{
    if ($required) {
        $classes .= ' input-required';
        $classes = trim($classes);
    }
    $output = '';
    $output .= '<div class="form-group"><label for="' . $name . '" class="col-sm-2 control-label">' . $label . ($required ? ' <span class="required">*</span>' : '') . '</label>';
    $output .= '<div class="col-sm-10">';
    if ($type == 'textarea' || $type == 'longtext') {
        $output .= textarea_input($name, $classes, $state, $default_value, $additional_attributes);
    } else {
        if ($type == 'select' || $type == 'dropdown') {
            $output .= select_input($name, $options, $classes, $state, $default_value, $additional_attributes);
        } else {
            if ($type == 'checkbox') {
                $output .= checkbox_input($options, $default_value);
            } else {
                if ($type == 'radio' || $type == 'switch') {
                    $output .= radio_input($options, $name, $default_value);
                } else {
                    $output .= text_input($type, $name, $classes, $state, $default_value, $additional_attributes);
                }
            }
        }
    }
    $output .= '<p class="help-block">' . $help . '</p></div>' . "\n";
    $output .= '</div>' . "\n";
    return $output;
}
예제 #14
0
    $tool_content .= "\n       <div class='alert alert-info'>{$langInfoLicence}</div>\n       <form class='form-horizontal' role='form' action='{$_SERVER['SCRIPT_NAME']}' method='post'>\n         <fieldset>\n           <div class='form-group'>\n             <pre class='pre-scrollable' style='col-sm-12'>" . q(wordwrap(file_get_contents('../info/license/gpl.txt'))) . "</pre>\n           </div>\n           <div class='form-group'>\n             <div class='col-sm-12'>" . icon('fa-print') . " <a href='{$gpl_link}'>{$langPrintVers}</a></div>\n           </div>\n           <div class='form-group'>\n              <div class='col-sm-10 col-offset-2 text-left'>\n                <input type='submit' class='btn btn-default' name='install1' value='&laquo; {$langPreviousStep}'>\n                <input type='submit' class='btn btn-primary' name='install3' value='{$langAccept}'>\n              </div>\n           </div>\n         </fieldset>" . hidden_vars($all_vars) . "</form>";
    draw($tool_content);
} elseif (isset($_POST['install3'])) {
    $langStepTitle = $langDBSetting;
    $langStep = $langStep3;
    $_SESSION['step'] = 3;
    $tool_content .= "\n       <div class='alert alert-info'>{$langWillWrite} {$langDBSettingIntro}</div>\n       <form class='form-horizontal' role='form' action='{$_SERVER['SCRIPT_NAME']}' method='post'>\n         <fieldset>\n           <div class='form-group'>\n\t         <label for='dbHostForm' class='col-sm-2 control-label'>{$langdbhost}</label>\n             <div class='col-sm-8'>" . text_input('dbHostForm', 25) . "</div>\n             <div class='col-sm-2'>{$langEG} localhost</div>\n           </div>\n           <div class='form-group'>\n\t         <label for='dbUsernameForm' class='col-sm-2 control-label'>{$langDBLogin}</label>\n             <div class='col-sm-8'>" . text_input('dbUsernameForm', 25) . "</div>\n             <div class='col-sm-2'>{$langEG} root</div>\n           </div>\n           <div class='form-group'>\n\t         <label for='dbPassForm' class='col-sm-2 control-label'>{$langDBPassword}</label>\n             <div class='col-sm-8'>" . text_input('dbPassForm', 25) . "</div>\n           </div>\n           <div class='form-group'>\n\t         <label for='dbNameForm' class='col-sm-2 control-label'>{$langMainDB}</label>\n             <div class='col-sm-8'>" . text_input('dbNameForm', 25) . "</div>\n             <div class='col-sm-2'>{$langNeedChangeDB}</div>\n           </div>\n           <div class='form-group'>\n\t         <label for='dbMyAdmin' class='col-sm-2 control-label'>{$langphpMyAdminURL}</label>\n             <div class='col-sm-8'>" . text_input('dbMyAdmin', 25) . "</div>\n             <div class='col-sm-2'>{$langOptional}</div>\n           </div>\n           <div class='form-group'>\n             <input type='submit' class='btn btn-default' name='install2' value='&laquo; {$langPreviousStep}'>\n\t\t     <input type='submit' class='btn btn-primary' name='install4' value='{$langNextStep} &raquo;'>\n           </div>\n           <div class='form-group'>\n             <div class='col-sm-12'>{$langAllFieldsRequired}</div>\n           </div>\n         </fieldset>" . hidden_vars($all_vars) . "</form>";
    draw($tool_content);
} elseif (isset($_POST['install4'])) {
    $langStepTitle = $langBasicCfgSetting;
    $langStep = $langStep4;
    $_SESSION['step'] = 4;
    if (empty($helpdeskmail)) {
        $helpdeskmail = '';
    }
    $tool_content .= "\n       <form class='form-horizontal' role='form' action='{$_SERVER['SCRIPT_NAME']}' method='post'>\n         <fieldset>" . form_entry('urlForm', text_input('urlForm', 40), "{$langSiteUrl} (*)") . form_entry('nameForm', text_input('nameForm', 40), "{$langAdminName} (*)") . form_entry('emailForm', text_input('emailForm', 40), "{$langAdminEmail} (*)") . form_entry('loginForm', text_input('loginForm', 40), "{$langAdminLogin} (*)") . form_entry('passForm', text_input('passForm', 40), "{$langAdminPass} (*)") . form_entry('campusForm', text_input('campusForm', 40), $langCampusName) . form_entry('helpdeskForm', text_input('helpdeskForm', 40), $langHelpDeskPhone) . form_entry('faxForm', text_input('faxForm', 40), $langHelpDeskFax) . form_entry('helpdeskmail', text_input('helpdeskmail', 40), "{$langHelpDeskEmail} (**)") . form_entry('institutionForm', text_input('institutionForm', 40), $langInstituteShortName) . form_entry('institutionUrlForm', text_input('institutionUrlForm', 40), $langInstituteName) . form_entry('postaddressForm', textarea_input('postaddressForm', 3, 40), $langInstitutePostAddress) . form_entry('eclass_stud_reg', selection_input(array('2' => $langDisableEclassStudRegType, '1' => $langReqRegUser, '0' => $langDisableEclassStudReg), 'eclass_stud_reg'), "{$langUserAccount} {$langViaeClass}") . form_entry('eclass_prof_reg', selection_input(array('1' => $langReqRegProf, '0' => $langDisableEclassProfReg), 'eclass_prof_reg'), "{$langProfAccount} {$langViaeClass}") . "\n           <div class='form-group'>\n             <input type='submit' class='btn btn-default' name='install3' value='&laquo; {$langPreviousStep}'>\n\t\t     <input type='submit' class='btn btn-primary' name='install5' value='{$langNextStep} &raquo;'>\n           </div>\n           <div class='form-group'>\n             <div class='col-sm-12'>{$langRequiredFields}</div>\n\t         <div class='col-sm-12'>(**) {$langWarnHelpDesk}</div></td>\n           </div>\n         </fieldset>" . hidden_vars($all_vars) . "</form>";
    draw($tool_content);
} elseif (isset($_POST['install5'])) {
    $langStepTitle = $langLastCheck;
    $langStep = $langStep5;
    $_SESSION['step'] = 5;
    switch ($eclass_stud_reg) {
        case '0':
            $disable_eclass_stud_reg_info = $langDisableEclassStudRegYes;
            break;
        case '1':
            $disable_eclass_stud_reg_info = $langDisableEclassStudRegViaReq;
            break;
        case '2':
            $disable_eclass_stud_reg_info = $langDisableEclassStudRegNo;
            break;
예제 #15
0
        if (!preg_match("/^[a-zA-Z ]+\$/", $username)) {
            $usernameErr = "只能为字母或者空格";
        }
    }
    if (empty($_POST['email'])) {
        $emailErr = "邮箱不能为空";
    } else {
        $email = text_input($_POST['email']);
        if (!preg_match("/([\\w\\-]+\\@[\\w\\-]+\\.[\\w\\-]+)/", $email)) {
            $emailErr = "请你输入合格的邮箱地址";
        }
    }
    if (empty($_POST['website'])) {
        $website = "";
    } else {
        $website = text_input($_POST['website']);
        if (!preg_match("/\\b(?:(?:https?|ftp):\\/\\/|www\\.)[-a-z0-9+&#\\/%\\/?=~_|!:,.;]*[-a-z0-9+&@#\\/%#=~_|]/i", $website)) {
            $websiteErr = "请输入合格的网址";
        }
    }
    if (empty($_POST['usercomment'])) {
        $usercomment = '';
    } else {
        $usercomment = text_input($_POST['usercomment']);
    }
    if (empty($_POST['sex'])) {
        $sexErr = "性别不能为空";
    } else {
        $sex = text_input($_POST['sex']);
    }
}
예제 #16
0
and merely copy them to the 'target' person. That, however, is a different can
of worms, and is currently not implemented.
*/
require "../settings/settings.php";
require_once "../langs/{$language}.php";
require "../functions.php";
require "./forms.php";
if (!isset($_POST['posted'])) {
    $person = $_GET['person'];
    $title = "{$_Merge_persons}";
    require "./form_header.php";
    echo "<h2>{$title}</h2>\n";
    form_begin('person_merge', $_SERVER['PHP_SELF']);
    hidden_input('posted', 1);
    text_input("Person 1:", 10, 'person_1', $person);
    text_input("Person 2:", 10, 'person_2');
    form_submit();
    form_end();
    echo "</body>\n</html>\n";
} else {
    $person_1 = $_POST['person_1'];
    $person_2 = $_POST['person_2'];
    // To avoid messups, this script will run some checks to ensure that the
    // two merge candidates are sufficiently identical. As a minimum, we'll
    // check if given name, sex, and birth year are within bounds.
    $row_1 = fetch_row_assoc("\n        SELECT\n            given,\n            patronym,\n            gender,\n            f_year(get_pbdate({$person_1})) AS pbd\n        FROM\n            persons\n        WHERE\n            person_id = {$person_1}\n    ");
    $row_2 = fetch_row_assoc("\n        SELECT\n            given,\n            patronym,\n            gender,\n            f_year(get_pbdate({$person_2})) AS pbd\n        FROM\n            persons\n        WHERE\n            person_id = {$person_2}\n    ");
    $given_1f = fonetik($row_1['given']);
    $given_2f = fonetik($row_2['given']);
    $patronym_1f = fonetik($row_1['patronym']);
    $patronym_2f = fonetik($row_2['patronym']);
예제 #17
0
    $title = "Lag lenke";
    $form = 'linkage_add';
    $focus = 'text';
    $per_id = fetch_val("SELECT COUNT(*) + 1 FROM source_linkage WHERE source_fk={$node}");
    require "./form_header.php";
    echo "<h2>Lag lenke</h2>\n";
    echo '<p>' . fetch_val("SELECT source_text FROM sources WHERE source_id={$node}") . "</p>\n";
    form_begin($form, $_SERVER['PHP_SELF']);
    hidden_input('posted', 1);
    hidden_input('node', $node);
    // per_id
    text_input("Lnr.: ", 10, 'per_id', $per_id);
    // role_fk
    select_role();
    person_id_input(0, 'person_id', 'Person:');
    select_surety();
    text_input("Navn i kilden: ", 100, 's_name');
    textarea_input("Note: ", 5, 100, 'sl_note');
    form_submit();
    form_end();
    echo "<h3>Personer nevnt i kilden:</h3>\n";
    list_mentioned($node, 0);
    echo "</body>\n</html>\n";
} else {
    $node = $_POST['node'];
    $note = rtrim($_POST['sl_note']);
    pg_prepare("query", "INSERT INTO\n            source_linkage(\n                source_fk,\n                per_id,\n                role_fk,\n                person_fk,\n                surety_fk,\n                s_name,\n                sl_note\n            )\n        VALUES (\$1, \$2, \$3, \$4, \$5, \$6, \$7)");
    pg_execute("query", array($node, $_POST['per_id'], $_POST['role_id'], $_POST['person_id'] ? $_POST['person_id'] : NULL, $_POST['surety'], $_POST['s_name'], $note));
    // return to parent node
    header("Location: {$app_root}/source_manager.php?node={$node}");
}
function rss_db_bk($event, $step)
{
    global $prefs, $rss_dbbk_path, $rss_dbbk_dump, $rss_dbbk_mysql, $rss_dbbk_lock, $rss_dbbk_txplog, $rss_dbbk_debug, $DB, $file_base_path;
    if (!isset($rss_dbbk_lock)) {
        $rss_dbbk_lock = "1";
        $rs = safe_insert('txp_prefs', "name='rss_dbbk_lock', val='{$rss_dbbk_lock}', prefs_id='1'");
    }
    if (!isset($rss_dbbk_txplog)) {
        $rss_dbbk_txplog = "1";
        $rs = safe_insert('txp_prefs', "name='rss_dbbk_txplog', val='{$rss_dbbk_txplog}', prefs_id='1'");
    }
    if (!isset($rss_dbbk_debug)) {
        $rss_dbbk_debug = "0";
        $rs = safe_insert('txp_prefs', "name='rss_dbbk_debug', val='{$rss_dbbk_debug}', prefs_id='1'");
    }
    if (!isset($rss_dbbk_path)) {
        $rss_dbbk_path = $file_base_path;
        $rs = safe_insert('txp_prefs', "name='rss_dbbk_path', val='" . addslashes($rss_dbbk_path) . "', prefs_id='1'");
    }
    if (!isset($rss_dbbk_dump)) {
        $rss_dbbk_dump = "mysqldump";
        $rs = safe_insert('txp_prefs', "name='rss_dbbk_dump', val='" . addslashes($rss_dbbk_dump) . "', prefs_id='1'");
    }
    if (!isset($rss_dbbk_mysql)) {
        $rss_dbbk_mysql = "mysql";
        $rs = safe_insert('txp_prefs', "name='rss_dbbk_mysql', val='" . addslashes($rss_dbbk_mysql) . "', prefs_id='1'");
    }
    include txpath . '/include/txp_prefs.php';
    $bkpath = $rss_dbbk_path;
    $iswin = preg_match('/Win/', php_uname());
    $mysql_hup = ' -h' . $DB->host . ' -u' . $DB->user . ' -p' . escapeshellcmd($DB->pass);
    $txplogps = ps('rss_dbbk_txplog');
    if (ps("save")) {
        pagetop("DB Manager", "Preferences Saved");
        safe_update("txp_prefs", "val = '" . addslashes(ps('rss_dbbk_path')) . "'", "name = 'rss_dbbk_path' and prefs_id ='1'");
        safe_update("txp_prefs", "val = '" . addslashes(ps('rss_dbbk_dump')) . "'", "name = 'rss_dbbk_dump' and prefs_id ='1'");
        safe_update("txp_prefs", "val = '" . addslashes(ps('rss_dbbk_mysql')) . "'", "name = 'rss_dbbk_mysql' and prefs_id ='1'");
        safe_update("txp_prefs", "val = '" . ps('rss_dbbk_lock') . "'", "name = 'rss_dbbk_lock' and prefs_id ='1'");
        if (isset($txplogps)) {
            safe_update("txp_prefs", "val = '" . ps('rss_dbbk_txplog') . "'", "name = 'rss_dbbk_txplog' and prefs_id ='1'");
        }
        safe_update("txp_prefs", "val = '" . ps('rss_dbbk_debug') . "'", "name = 'rss_dbbk_debug' and prefs_id ='1'");
        header("Location: index.php?event=rss_db_bk");
    } else {
        if (gps("bk")) {
            $bk_table = gps("bk_table") ? " --tables " . gps("bk_table") . " " : "";
            $tabpath = gps("bk_table") ? "-" . gps("bk_table") : "";
            $gzip = gps("gzip");
            $filename = time() . '-' . $DB->db . $tabpath;
            $backup_path = $bkpath . '/' . $filename . '.sql';
            $lock = $rss_dbbk_lock ? "" : " --skip-lock-tables --skip-add-locks ";
            echo $txplogps;
            $nolog = $rss_dbbk_txplog ? "" : " --ignore-table=" . $DB->db . ".txp_log ";
            $nolog = isset($bk_table) && gps("bk_table") == "txp_log" ? "" : $nolog;
            if ($gzip) {
                $backup_path .= '.gz';
                $backup_cmd = $rss_dbbk_dump . $mysql_hup . ' -Q --add-drop-table ' . $lock . $nolog . $DB->db . $bk_table . ' | gzip > ' . $backup_path;
            } else {
                $backup_cmd = $rss_dbbk_dump . $mysql_hup . ' -Q --add-drop-table ' . $lock . $nolog . $DB->db . $bk_table . ' > ' . $backup_path;
            }
            $bkdebug = $rss_dbbk_debug ? $backup_cmd : '';
            $error = "";
            if (function_exists('passthru')) {
                passthru($backup_cmd, $error);
            } else {
                $dumpIt = popen($backup_cmd, 'r');
                pclose($dumpIt);
            }
            if (!is_writable($bkpath)) {
                pagetop("DB Manager", "BACKUP FAILED: folder is not writable");
            } elseif ($error) {
                unlink($backup_path);
                pagetop("DB Manager", "BACKUP FAILED.  ERROR NO: " . $error);
            } else {
                if (!is_file($backup_path)) {
                    pagetop("DB Manager", "BACKUP FAILED.  ERROR NO: " . $error);
                } else {
                    if (filesize($backup_path) == 0) {
                        unlink($backup_path);
                        pagetop("DB Manager", "BACKUP FAILED.  ERROR NO: " . $error);
                    } else {
                        pagetop("DB Manager", "Backed Up: " . $DB->db . " to " . $filename);
                    }
                }
            }
        } else {
            if (gps("download")) {
                $fn = gps("download");
                $file_path = $bkpath . '/' . $fn;
                header("Pragma: public");
                header("Expires: 0");
                header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
                header("Content-Type: application/force-download");
                header("Content-Type: application/octet-stream");
                header("Content-Type: application/download");
                if (substr($fn, -2) == "gz") {
                    header("Content-Type: application/zip");
                }
                header("Content-Disposition: attachment; filename=" . basename($file_path) . ";");
                header("Content-Transfer-Encoding: binary");
                header("Content-Length: " . filesize($file_path));
                @readfile($file_path);
            } else {
                if (gps("restore")) {
                    if (stristr(gps("restore"), '.gz')) {
                        $backup_cmd = 'gunzip < ' . $bkpath . '/' . gps("restore") . ' | ' . $rss_dbbk_mysql . $mysql_hup . ' ' . $DB->db;
                    } else {
                        $backup_cmd = $rss_dbbk_mysql . $mysql_hup . ' ' . $DB->db . ' < ' . $bkpath . '/' . gps("restore");
                    }
                    $bkdebug = $rss_dbbk_debug ? $backup_cmd : '';
                    $error = "";
                    if (function_exists('passthru')) {
                        passthru($backup_cmd, $error);
                    } else {
                        $dumpIt = popen($backup_cmd, 'r');
                        pclose($dumpIt);
                    }
                    if ($error) {
                        pagetop("DB Manager", "FAILED TO RESTORE: " . $error);
                    } else {
                        pagetop("DB Manager", "Restored: " . gps("restore") . " to " . $DB->db);
                    }
                } else {
                    if (gps("delete")) {
                        if (is_file($bkpath . '/' . gps("delete"))) {
                            if (!unlink($bkpath . '/' . gps("delete"))) {
                                pagetop("DB Manager", "Unable to Delete: " . gps("delete"));
                            } else {
                                pagetop("DB Manager", "Deleted: " . gps("delete"));
                            }
                        } else {
                            pagetop("DB Manager", "Unable to Delete: " . gps("delete"));
                        }
                    } else {
                        pagetop("DB Backup");
                    }
                }
            }
        }
    }
    $gzp = !$iswin ? " | " . href('gzipped file', "index.php?event=rss_db_bk&amp;bk={$DB->db}&amp;gzip=1") : "";
    $sqlversion = getRow("SELECT VERSION() AS version");
    $sqlv = explode("-", $sqlversion['version']);
    $allownologs = (double) $sqlv[0] >= (double) "4.1.9" ? tda(gTxt('Include txp_log:'), ' style="text-align:right;vertical-align:middle"') . tda(yesnoRadio("rss_dbbk_txplog", $rss_dbbk_txplog), ' style="text-align:left;vertical-align:middle"') : '';
    if (isset($bkdebug) && $bkdebug) {
        echo '<p align="center">' . $bkdebug . '</p>';
    }
    echo startTable('list') . form(tr(tda(gTxt('Lock Tables:'), ' style="text-align:right;vertical-align:middle"') . tda(yesnoRadio("rss_dbbk_lock", $rss_dbbk_lock), ' style="text-align:left;vertical-align:middle"') . $allownologs . tda(gTxt('Debug Mode:'), ' style="text-align:right;vertical-align:middle"') . tda(yesnoRadio("rss_dbbk_debug", $rss_dbbk_debug), ' style="text-align:left;vertical-align:middle"') . tda(fInput("submit", "save", gTxt("save_button"), "publish") . eInput("rss_db_bk") . sInput('saveprefs'), " colspan=\"2\" class=\"noline\"")) . tr(tda(gTxt('Backup Path:'), ' style="text-align:right;vertical-align:middle"') . tda(text_input("rss_dbbk_path", $rss_dbbk_path, '50'), ' colspan="15"')) . tr(tda(gTxt('mysqldump Path:'), ' style="text-align:right;vertical-align:middle"') . tda(text_input("rss_dbbk_dump", $rss_dbbk_dump, '50'), ' colspan="15"')) . tr(tda(gTxt('mysql Path:'), ' style="text-align:right;vertical-align:middle"') . tda(text_input("rss_dbbk_mysql", $rss_dbbk_mysql, '50'), ' colspan="15"'))) . endTable() . startTable("list") . tr(tda(hed('Create a new backup of the ' . $DB->db . ' database' . br . href('.sql file', "index.php?event=rss_db_bk&amp;bk={$DB->db}") . $gzp, 3), ' colspan="7" style="text-align:center;"')) . tr(tdcs(hed("Previous Backup Files", 1), 7)) . tr(hcell("No.") . hcell("Backup File Name") . hcell("Backup Date/Time") . hcell("Backup File Size") . hcell("") . hcell("") . hcell(""));
    $totalsize = 0;
    $no = 0;
    if (!is_folder_empty($bkpath)) {
        if ($handle = opendir($bkpath)) {
            $database_files = array();
            while (false !== ($file = readdir($handle))) {
                if ($file != '.' && $file != '..' && (substr($file, -4) == ".sql" || substr($file, -7) == ".sql.gz")) {
                    $database_files[] = $file;
                }
            }
            closedir($handle);
            for ($i = sizeof($database_files) - 1; $i > -1; $i--) {
                $no++;
                $style = $no % 2 == 0 ? ' style="background-color: #eee;"' : '';
                $database_text = substr($database_files[$i], 11);
                $date_text = strftime("%A, %B %d, %Y [%H:%M:%S]", substr($database_files[$i], 0, 10));
                $size_text = filesize($bkpath . '/' . $database_files[$i]);
                $totalsize += $size_text;
                echo tr(td($no) . td($database_text) . td($date_text) . td(prettyFileSize($size_text)) . '<td><a href="index.php?event=rss_db_bk&amp;download=' . $database_files[$i] . '">Download</a></td>' . '<td><a href="index.php?event=rss_db_bk&amp;restore=' . $database_files[$i] . '"  onclick="return verify(\'' . gTxt('are_you_sure') . '\')">Restore</a></td>' . '<td><a href="index.php?event=rss_db_bk&amp;delete=' . $database_files[$i] . '"  onclick="return verify(\'' . gTxt('are_you_sure') . '\')">Delete</a></td>', $style);
            }
            echo tr(tag($no . " Backup File(s)", "th", ' colspan="3"') . tag(prettyFileSize($totalsize), "th", ' colspan="4"'));
        } else {
            echo tr(tda(hed('You have no database backups' . br . 'Create a new backup of the ' . $DB->db . ' database' . br . href('.sql file', "index.php?event=rss_db_bk&amp;bk={$DB->db}") . $gzp, 3), ' colspan="7" style="text-align:center;"'));
        }
    } else {
        echo tr(tda(hed('You have no database backups' . br . 'Create a new backup of the ' . $DB->db . ' database' . br . href('.sql file', "index.php?event=rss_db_bk&amp;bk={$DB->db}") . $gzp, 3), ' colspan="7" style="text-align:center;"'));
    }
    echo endTable();
}
예제 #19
0
        $subject_options[$subject] = $subject;
    }
}
echo create_bootstrap_input('select', 'subjects[]', $subject_options, 'Subject(s)', 'chosen-ajax', '', isset($record->subjects_array) && $record->subjects_array ? unserialize($record->subjects_array) : '', 'multiple="multiple" data-ajax-source="' . site_url('/taxonomy/ajax/subject') . '"', 'Give one or more subject/topic terms of this resource');
echo create_bootstrap_input('textarea', 'abstract', null, 'Abstract', '', '', isset($record->abstract) ? $record->abstract : '', '', 'Write an abstract in one or two paragraph explaining this resource');
echo create_bootstrap_input('text', 'classification', null, 'Classification', '', '', isset($record->classification) ? $record->classification : '', '', 'Give one or more in comma separated classification code in DDC, UDC or LC format related to this Subject');
echo create_bootstrap_input('select', 'location', $this->Taxonomy_model->getForSelect('location', 100, true), 'Resource Location', 'chosen-ajax', '', isset($record->location) ? $record->location : '', 'data-ajax-source="' . site_url('/taxonomy/ajax/location') . '"', 'Name of place where this resource located');
echo create_bootstrap_input('text', 'publish_year', null, 'Publish year', '', '', isset($record->publish_year) ? $record->publish_year : '', '', 'Year of publication of this resource');
echo create_bootstrap_input('select', 'publisher', $this->Taxonomy_model->getForSelect('publisher', 100, true), 'Publisher', 'chosen-ajax', '', isset($record->publisher) ? $record->publisher : '', 'data-ajax-source="' . site_url('/taxonomy/ajax/publisher') . '"', 'Name of publisher for this resource');
echo create_bootstrap_input('select', 'publish_place', $this->Taxonomy_model->getForSelect('place', 100, true), 'Publish Place', 'chosen-ajax', '', isset($record->publish_place) ? $record->publish_place : '', 'data-ajax-source="' . site_url('/taxonomy/ajax/place') . '"', 'Name of publisher for this resource');
echo create_bootstrap_input('select', 'format', $this->Taxonomy_model->getForSelect('format', 100, true), 'Format', '', '', isset($record->format) ? $record->format : '', '', 'Format of this resource');
echo create_bootstrap_input('select', 'language', $this->Taxonomy_model->getForSelect('language', 100, true), 'Language', '', '', isset($record->language) ? $record->language : '', '', 'Language of this resource content');
echo create_bootstrap_input('text', 'collation', null, 'Collation/Physical Description', '', '', isset($record->collation) ? $record->collation : '', '', 'Physical description of this resource such as page numbers');
echo create_bootstrap_input('text', 'doi_id', null, 'Digital Object Identifier (DOI)', '', '', isset($record->doi_id) ? $record->doi_id : '', '', 'DOI identifier of this resource');
echo create_bootstrap_input('text', 'isbn', null, 'ISBN', '', '', isset($record->isbn) ? $record->isbn : '', '', 'ISBN number');
echo create_bootstrap_input('text', 'issn', null, 'ISSN', '', '', isset($record->issn) ? $record->issn : '', '', 'ISSN number');
echo create_bootstrap_input('text', 'other_id', null, 'Other ID', '', '', isset($record->other_id) ? $record->other_id : '', '', 'Other ID/local ID for this resource');
echo create_bootstrap_input('text', 'url', null, 'URL', '', '', isset($record->url) ? $record->url : '', '', 'URL for this resource');
echo create_bootstrap_input('file', 'filename', array(), 'File', '', '', '', '', 'Digital file of this resource. DON\'T UPLOAD copyrighted material unless you have license to it');
if (isset($pathfinder_ID)) {
    echo text_input('hidden', 'pathfinder_ID', '', '', $pathfinder_ID);
}
if (isset($update_ID)) {
    echo text_input('hidden', 'update_ID', '', '', $update_ID);
}
echo text_input('submit', 'save', 'btn btn-primary', '', 'Save Resource');
?>
</form>
<?php 
$main_content = ob_get_clean();
require './assets/themes/default/index.tpl.php';
예제 #20
0
    // section: User details
    echo "<tr><td colspan=\"2\"><b>{$_User_details}</b></td></tr>\n";
    text_input("{$_Full_name}:", 40, 'user_full_name', $settings['user_full_name']);
    text_input("{$_Email_addr}:", 40, 'user_email', $settings['user_email']);
    text_input("{$_Initials}:", 10, 'initials', $settings['initials']);
    echo "<tr><td colspan=\"2\">&nbsp;</td></tr>\n";
    // Section: place filter settings
    echo "<tr><td colspan=\"2\"><b>{$_Place_filter}</b></td></tr>\n";
    echo "<tr><td>{$_Level}:  </td><td>\n<select name=\"place_filter_level\">\n";
    $place_desc = 'desc_' . $language;
    // desc_en or desc_nb
    $handle = pg_query("\n        SELECT\n            place_level_name,\n            {$place_desc}\n        FROM\n            place_level_desc\n        ORDER BY place_level_id ASC\n    ");
    while ($rec = pg_fetch_assoc($handle)) {
        $option = "<option ";
        if ($rec['place_level_name'] == $settings['place_filter_level']) {
            $option .= "selected=\"selected\" ";
        }
        $option .= "value=\"" . $rec['place_level_name'] . "\">" . $rec[$place_desc] . "</option>\n";
        echo $option;
    }
    echo "</select></td></tr>\n";
    text_input("{$_Contents}:", 10, 'place_filter_content', $settings['place_filter_content']);
    echo "<tr><td colspan=\"2\">&nbsp;</td></tr>\n";
    form_submit();
    form_end();
    echo "</body>\n</html>\n";
} else {
    // do update
    pg_query("\n        UPDATE\n            user_settings\n        SET\n            user_full_name = '" . $_POST['user_full_name'] . "',\n            user_email = '" . $_POST['user_email'] . "',\n            place_filter_level = '" . $_POST['place_filter_level'] . "',\n            place_filter_content = '" . $_POST['place_filter_content'] . "',\n            initials = '" . $_POST['initials'] . "',\n            user_lang = '" . $_POST['user_lang'] . "'\n        WHERE\n            username = current_user\n    ");
    header("Location: {$app_root}/index.php");
}
예제 #21
0
        $place = fetch_row_assoc("SELECT * FROM places WHERE place_id = {$place_id}");
        $level_1 = $place['level_1'];
        $level_2 = $place['level_2'];
        $level_3 = $place['level_3'];
        $level_4 = $place['level_4'];
        $level_5 = $place['level_5'];
    }
    echo "<h2>{$title}</h2>\n";
    form_begin('place_edit', $_SERVER['PHP_SELF']);
    hidden_input('posted', 1);
    hidden_input('place_id', $place_id);
    text_input(get_place_desc(1), 80, 'level_1', $level_1);
    text_input(get_place_desc(2), 80, 'level_2', $level_2);
    text_input(get_place_desc(3), 80, 'level_3', $level_3);
    text_input(get_place_desc(4), 80, 'level_4', $level_4);
    text_input(get_place_desc(5), 80, 'level_5', $level_5);
    form_submit();
    form_end();
    echo "</body>\n</html>\n";
} else {
    $place_id = $_POST['place_id'];
    $level_1 = note_to_db($_POST['level_1']);
    $level_2 = $_POST['level_2'];
    $level_3 = $_POST['level_3'];
    $level_4 = $_POST['level_4'];
    $level_5 = $_POST['level_5'];
    if ($place_id == 0) {
        // insert new place
        pg_query("BEGIN WORK");
        $place_id = fetch_val("\n            INSERT INTO places (\n                level_1,\n                level_2,\n                level_3,\n                level_4,\n                level_5\n            )\n            VALUES (\n                '{$level_1}',\n                '{$level_2}',\n                '{$level_3}',\n                '{$level_4}',\n                '{$level_5}'\n            )\n            RETURNING place_id\n        ");
        pg_query("COMMIT");
require "../functions.php";
require "./forms.php";
if (!isset($_POST['posted'])) {
    // do form
    $person = $_GET['person'];
    $event = $_GET['event'];
    $node = $_GET['node'];
    $name = get_name($person);
    $srt = fetch_val("\n        SELECT sort_order\n        FROM participants\n        WHERE person_fk = {$person}\n        AND event_fk = {$event}\n    ");
    $title = "Edit sort order for {$name} @ #{$event}";
    require "./form_header.php";
    echo "<h2>{$title}</h2>\n";
    // print paragraph with event text here
    form_begin('edit_event', $_SERVER['PHP_SELF']);
    hidden_input('person', $person);
    hidden_input('event', $event);
    hidden_input('node', $node);
    hidden_input('posted', 1);
    text_input("Sort order:", 10, 'srt', $srt);
    form_submit();
    form_end();
    echo "</body>\n</html>\n";
} else {
    // do action
    $person = $_POST['person'];
    $event = $_POST['event'];
    $node = $_POST['node'];
    $srt = $_POST['srt'];
    pg_query("\n        UPDATE participants\n        SET sort_order = {$srt}\n        WHERE person_fk = {$person}\n        AND event_fk = {$event}\n    ");
    header("Location: {$app_root}/source_manager.php?node={$node}");
}
예제 #23
0
    echo "<h2>{$_Add_source} ({$spt_label})</h2>\n";
    form_begin($form, $_SERVER['PHP_SELF']);
    hidden_input('posted', 1);
    source_num_input("{$_Parent_node}:", 'node', $node);
    editarea_input("{$_Text}:", 20, 100, 'text', $template);
    if (fetch_val("\n        SELECT is_leaf FROM source_part_types WHERE part_type_id = {$part_type}\n    ") == 't') {
        hidden_input('template', false);
        hidden_input('part_type', $part_type);
        hidden_input('ch_part_type', 0);
    } else {
        textarea_input('Template:', 3, 100, 'template');
        select_source_type('Type:', 'part_type', $part_type);
        select_source_type("{$_Subtype}:", 'ch_part_type', 0);
    }
    text_input("{$_Sort_order}:", 20, 'sort');
    text_input("{$_Source_date}:", 20, 'source_date');
    form_submit();
    form_end();
    echo "</body>\n</html>\n";
} else {
    $node = $_POST['node'];
    $text = rtrim($_POST['text']);
    // SMS 20 July 2011: was [$sort = $_POST['sort'] ?: 1;] generated php syntax error if sort was null
    $sort = $_POST['sort'] ? $_POST['sort'] : 1;
    $part_type = $_POST['part_type'];
    $ch_part_type = $_POST['ch_part_type'];
    $source_date = $_POST['source_date'];
    $template = $_POST['template'];
    pg_query("BEGIN");
    $source_id = add_source(0, 0, 0, $node, $text, $sort);
    if ($source_id > 0) {
예제 #24
0
    } else {
        $title = "{$_Edit} {$_source_type} #{$spt}";
        $spt_row = fetch_row_assoc("\n            SELECT\n                label_en,\n                label_nb,\n                description,\n                is_leaf\n            FROM\n                source_part_types\n            WHERE\n                part_type_id = {$spt}\n        ");
        $label_en = $spt_row['label_en'];
        $label_nb = $spt_row['label_nb'];
        $description = $spt_row['description'];
        $is_leaf = $spt_row['is_leaf'];
    }
    require "./form_header.php";
    echo "<h2>{$title}</h2>\n";
    form_begin('spt_edit', $_SERVER['PHP_SELF']);
    hidden_input('posted', 1);
    hidden_input('spt', $spt);
    text_input("Description:", 80, 'description', $description);
    text_input("Label (en):", 40, 'label_en', $label_en);
    text_input("Label (nb):", 40, 'label_nb', $label_nb);
    select_bool("Is leaf", 'is_leaf', $is_leaf);
    form_submit();
    form_end();
    echo "</body>\n</html>\n";
} else {
    $spt = $_POST['spt'];
    $description = $_POST['description'];
    $label_en = $_POST['label_en'];
    $label_nb = $_POST['label_nb'];
    $is_leaf = $_POST['is_leaf'];
    if ($spt == 0) {
        // insert new source part type
        pg_query("BEGIN");
        $spt = fetch_val("\n        SELECT MAX(part_type_id) FROM source_part_types\n        ") + 1;
        pg_query("\n            INSERT INTO source_part_types (\n                part_type_id,\n                description,\n                label_en,\n                label_nb,\n                is_leaf\n            )\n            VALUES (\n                {$spt},\n                '{$description}',\n                '{$label_en}',\n                '{$label_nb}',\n                '{$is_leaf}'\n            )");
예제 #25
0
                    }
                }
            }
            echo "</table>";
            echo '<p>';
            echo '<a href="' . get_link('Mailbox', 'User', array("Write" => "mail")) . '">' . LanguageValidation::nMsg("btn.message.write") . '</a>';
            echo '</p>';
            if (empty($Private_Message_ID)) {
                echo 'Vous n\'avez aucun nouveau message';
            }
        } else {
            //Si l'utilisateur souhaite repondre à un message
            if (request_confirm('Reply')) {
                $Conversation = request_post('Private_Message_Conversation') == 0 ? request_post('Private_Message_ID') : request_post('Private_Message_Conversation');
                $Receiver = htmlspecialchars(addslashes($_POST['Transmitter']));
                $Message_Subject = htmlspecialchars(addslashes($_POST['Message_Subject']));
                $Message = htmlspecialchars(addslashes($_POST['Message']));
                echo LanguageValidation::iMsg("intro.message.reply");
                echo formulaire_input(array(text_input("label.message.reply", "Receiver", $Receiver, null, null, "placeholder.message.reply", null, true), text_input("label.message.subject", "Message_Subject", "Re : {$Message_Subject}", null, null, "placeholder.message.subject", null, true), call_bbcode_editor("Message"), submit_input("Send", "btn.message.send")), "Mailbox-Send", get_link('Mailbox', 'User'), "post", null);
                echo bb_code($Message);
            } else {
                echo LanguageValidation::iMsg("intro.private.message");
                echo '<p>';
                echo '<a href="' . get_link('Mailbox', 'User', array("Write" => "mail")) . '">' . LanguageValidation::nMsg("btn.message.write") . '</a>';
                echo ' - ';
                echo '<a href="' . get_link('Mailbox', 'User', array("Read" => "box")) . '">' . LanguageValidation::nMsg("btn.message.read") . '</a>';
                echo '</p>';
            }
        }
    }
}
예제 #26
0
    $category_options[$category] = $category;
}
echo create_bootstrap_input('select', 'category', $category_options, 'Category', 'chosen', '', isset($record->category) ? $record->category : '', '', 'Choose category for this pathfinder', true);
echo create_bootstrap_input('text', 'scope', array(), 'Scope', '', '', isset($record->scope) ? $record->scope : '', '', 'Scope of this pathfinder');
echo create_bootstrap_input('text', 'target_users', array(), 'Target users', '', '', isset($record->target_users) ? $record->target_users : '', '', 'Intended user type for this pathfinder');
$subject_options = array();
$subjects = @unserialize($record->subjects_array);
if ($subjects) {
    foreach ($subjects as $subject) {
        $subject_options[$subject] = $subject;
    }
}
echo create_bootstrap_input('select', 'subjects[]', $subject_options, 'Subject(s)', 'chosen-ajax', '', isset($record->subjects_array) ? unserialize($record->subjects_array) : '', 'multiple="multiple" data-ajax-source="' . site_url('/taxonomy/ajax/subject') . '"', 'Give one or more subject/topic terms of this pathfinder');
$types = $this->Taxonomy_model->getForSelect('type', 100);
$type_options = array();
foreach ($types as $type) {
    $type_options[$type] = $type;
}
echo create_bootstrap_input('select', 'hidden_type[]', $type_options, 'Hidden Resource Type', 'chosen', '', $hidden_type, 'multiple="multiple"', 'Choose category for this pathfinder', true);
echo create_bootstrap_input('file', 'image_filename', array(), 'Image', '', '', '', '', 'Optional image representing this pathfinder');
if (isset($update_ID)) {
    echo text_input('hidden', 'update_ID', '', '', $update_ID);
    echo text_input('hidden', 'update_ID', '', '', $update_ID);
    echo ' ';
}
echo text_input('submit', 'save', 'btn btn-primary', '', 'Save Pathfinder');
?>
</form>
<?php 
$main_content = ob_get_clean();
require './assets/themes/default/index.tpl.php';
예제 #27
0
/**
 * Renders a HTML custom field.
 *
 * Can be altered by plugins via the 'prefs_ui > custom_set'
 * pluggable UI callback event.
 *
 * @param  string $name HTML name of the widget
 * @param  string $val  Initial (or current) content
 * @return string HTML
 * @todo   deprecate or move this when CFs are migrated to the meta store
 */
function custom_set($name, $val)
{
    return pluggable_ui('prefs_ui', 'custom_set', text_input($name, $val, INPUT_REGULAR), $name, $val);
}
예제 #28
0
    $focus = 'text';
    require "./form_header.php";
    echo "<h2>Rediger lenke {$id}</h2>\n";
    echo '<p>' . fetch_val("SELECT source_text FROM sources WHERE source_id={$node}") . "</p>\n";
    $row = fetch_row_assoc("SELECT * FROM source_linkage WHERE source_fk={$node} AND per_id={$id}");
    $person = $row['person_fk'] ? $row['person_fk'] : 0;
    form_begin($form, $_SERVER['PHP_SELF']);
    hidden_input('posted', 1);
    hidden_input('node', $node);
    hidden_input('per_id', $id);
    hidden_input('f_person', $f_person);
    // role_fk
    select_role($row['role_fk']);
    person_id_input($person, 'person_fk', 'Person: ');
    select_surety($row['surety_fk']);
    text_input("Navn i kilden: ", 100, 's_name', $row['s_name']);
    textarea_input("Note: ", 5, 100, 'sl_note', $row['sl_note']);
    form_submit();
    form_end();
    echo "<h3>Personer nevnt i kilden:</h3>\n";
    list_mentioned($node, 0);
    echo "</body>\n</html>\n";
} else {
    $node = $_POST['node'];
    $note = rtrim($_POST['sl_note']);
    $f_person = $_POST['f_person'];
    pg_prepare("query", "UPDATE\n            source_linkage\n        SET\n            role_fk = \$1,\n            person_fk = \$2,\n            surety_fk = \$3,\n            s_name = \$4,\n            sl_note = \$5\n        WHERE\n            source_fk = \$6\n        AND\n            per_id = \$7\n    ");
    pg_execute("query", array($_POST['role_id'], $_POST['person_fk'] ? $_POST['person_fk'] : NULL, $_POST['surety'], $_POST['s_name'], $note, $node, $_POST['per_id']));
    if ($f_person) {
        // called from family.php
        header("Location: {$app_root}/family.php?person={$f_person}");
예제 #29
0
function get_admin_tab($input, $head = true)
{
    switch ($input['type']) {
        case "upload":
            upload_input($input, $head);
            break;
        case "uploadbg":
            uploadbg_input($input, $head);
            break;
        case "text":
            text_input($input, $head);
            break;
        case "ptext":
            ptext_input($input, $head);
            break;
        case "color":
            color_input($input, $head);
            break;
        case "tags":
            tags_input($input, $head);
            break;
        case "textarea":
            textarea_input($input, $head);
            break;
        case "number":
            number_input($input, $head);
            break;
        case "checkbox":
            checkbox_input($input, $head);
            break;
        case "radio":
            radio_input($input, $head);
            break;
        case "radio_bgtype":
            radio_bgtype_input($input, $head);
            break;
        case "select":
            select_input($input, $head);
            break;
        case "slider_num":
            slider_num_input($input, $head);
            break;
        case "background_bd":
            background_bd_input($input, $head);
            break;
        case "typography":
            typography_input($input, $head);
            break;
    }
}
예제 #30
0
<?php

if (empty($_POST['Login'])) {
    /**
                
                //echo '<div id="login">';
        		echo '<form method="POST" action="'.get_link('Login','User').'"><br />';
        		echo '<label for="Pseudo">'.LanguageValidation::iMsg("label.login.pseudo").'</label><input placeholder="'.LanguageValidation::nMsg("placeholder.login.pseudo").'" type="text" name="Pseudo">'.LanguageValidation::eMsg("placeholder.login.pseudo").'<br /><br />';
        		echo '<label for="Password">'.LanguageValidation::iMsg("label.login.password").'</label><input placeholder="'.LanguageValidation::nMsg("placeholder.login.password").'" type="password" name="Password">'.LanguageValidation::eMsg("placeholder.login.password").'<br /><br />';
        		echo '<input type="hidden" name="token" value="'.generer_token('Login').'" />';
        		//echo '<input type="submit" name="Login" value="Se connecter">';
    			echo '<input type="submit" name="Login" value="'.LanguageValidation::nMsg("btn.login.init").'"/>'.LanguageValidation::eMsg("btn.login.init");
        		echo '</form>';
        		//echo '</div>';
        		
        		**/
    echo formulaire_input(array(text_input("label.login.pseudo", "Pseudo", null, null, null, "placeholder.login.pseudo"), password_input("label.login.password", "Password", null, null, null, "placeholder.login.password"), submit_input("Login", "btn.login.init")), "Login", get_link('Login', 'User'), "post", null);
}
if (isset($message) && $message !== '') {
    echo nl2br($message);
}