function editfield_display($field)
 {
     global $page_owner;
     static $usertype;
     if (!isset($usertype)) {
         $usertype = user_type($page_owner);
     }
     // copy array element with default to ''
     // If we're dealing with the old-style profile fields
     if (is_array($field)) {
         $flabel = !empty($field[0]) ? $field[0] : '';
         $fname = !empty($field[1]) ? $field[1] : '';
         $ftype = !empty($field[2]) ? $field[2] : '';
         $fblurb = !empty($field[3]) ? $field[3] : '';
         $fusertype = !empty($field[4]) ? $field[4] : '';
         $finvisible = false;
         $frequired = false;
         // Otherwise map things the new way!
     } else {
         $flabel = $field->name;
         $fname = $field->internal_name;
         $ftype = $field->field_type;
         $fblurb = $field->description;
         $fusertype = $field->user_type;
         $finvisible = $field->invisible;
         $frequired = $field->required;
     }
     if (!empty($fusertype) && $fusertype != $usertype) {
         return '';
     }
     global $page_owner;
     global $data;
     global $CFG;
     $run_result = '';
     if (empty($flabel) && empty($fname)) {
         return '';
     }
     if (!isset($data['profile:preload'][$fname])) {
         if (!($value = get_record('profile_data', 'name', $fname, 'owner', $page_owner))) {
             $value = "";
             $value->value = "";
             if (isset($field->default_access)) {
                 // default access can be set on a per profile field basis
                 $value->access = $field->default_access;
             } else {
                 $value->access = $CFG->default_access;
             }
         }
     } else {
         $value = "";
         $value->value = $data['profile:preload'][$fname];
         if (!isset($data['profile:preload:access'][$fname])) {
             if (isset($field->default_access)) {
                 $value->access = $field->default_access;
             } else {
                 $value->access = $CFG->default_access;
             }
         } else {
             $value->access = $data['profile:preload:access'][$fname];
         }
     }
     if ($finvisible) {
         $value->access = "PRIVATE";
     }
     $name = "<label for=\"{$fname}\"><b>{$flabel}</b>";
     if (!empty($fblurb)) {
         $name .= "<br /><i>" . $fblurb . "</i>";
     }
     $name .= '</label>';
     if (empty($ftype)) {
         $ftype = "text";
     }
     $column1 = display_input_field(array("profiledetails[" . $fname . "]", $value->value, $ftype, $fname, @$value->ident, $page_owner));
     $column2 = "<label>" . __gettext("Access Restriction:") . "<br />";
     $column2 .= run("display:access_level_select", array("profileaccess[" . $fname . "]", $value->access)) . "</label>";
     $run_result .= templates_draw(array('context' => 'databox', 'name' => $name, 'column1' => $column1, 'column2' => $column2));
     return $run_result;
 }
Example #2
0
                    </td>
                    <td width="70%">
END;
        $body .= run("folder:select", array("edit_file_folder", $file->files_owner, $file->folder));
        $keywords = gettext("Keywords (comma separated):");
        // gettext variable
        $body .= <<<END
                    </td>
                </tr>
                <tr>
                    <td width="30%">
                        <h4><label for="edit_file_keywords">{$keywords}</label></h4>
                    </td>
                    <td width="70%">
END;
        $body .= display_input_field(array("edit_file_keywords", "", "keywords", "file", $file_id));
        $body .= <<<END
                    </td>
                </tr>
END;
        $body .= run("metadata:edit", $file_id);
        $saveChanges = gettext("Save changes");
        // gettext variable
        $body .= <<<END
                
                <tr>
                    <td colspan="2" align="center"><br />
                        <input type="hidden" name="folder" value="{$folder}" />
                        <input type="hidden" name="file_id" value="{$file_id}" />
                        <input type="hidden" name="action" value="files:editfile" />
                        <input type="submit" value={$saveChanges} />
    if (isset($element['display']) && $element['display'] == 1) {
        $name = "<b>" . $element['name'] . "</b><br /><i>" . $element['description'] . "</i>";
        $glossary = __gettext("Glossary");
        // gettext variable
        if (sizeof($element['glossary']) > 0) {
            $column1 = "<b>{$glossary}</b><br />";
            foreach ($element['glossary'] as $gloss_id => $gloss_descr) {
                $column1 .= $gloss_id . " -- " . $gloss_descr . "<br />";
            }
        } else {
            $column1 = "";
        }
        if (empty($current_template[$element['id']])) {
            $current_template[$element['id']] = $template[$element['id']];
        }
        $column2 = display_input_field(array("template[" . $element['id'] . "]", $current_template[$element['id']], "longtext"));
        /*        
                $run_result .= templates_draw(array(
                                        'context' => 'databox',
                                        'name' => $name,
                                        'column2' => $column1,
                                        'column1' => $column2
                                    )
                                    );
        */
        $run_result .= templates_draw(array('context' => 'databoxvertical', 'name' => $name, 'contents' => $column1 . "<br />" . $column2));
    }
}
if ($editable) {
    $save = __gettext("Save");
    // gettext variable
Example #4
0
// gettext variable
$heading2 = gettext("Heading two");
// gettext variable
$bulletList = gettext("A bullet list");
// gettext variable
$heading3 = gettext("Heading three");
// gettext variable
$numberedList = gettext("A numbered list");
// gettext variable
$body = <<<END
        
    <img src="{{url}}_templates/leaves.jpg" width="300" height="225" alt="A test image" align="right" />
    <h1>{$heading1}</h1>
    <p>Paragraph text</p>
    <h2>{$heading2}</h2>
    <ul>
        <li>{$bulletList}</li>
    </ul>
    <h3>{$heading3}</h3>
    <ol>
        <li>{$numberedList}</li>
    </ol>
        
END;
$run_result .= templates_draw(array('context' => 'contentholder', 'title' => $name, 'body' => $body));
// Form elements
$name = "Data input";
$body = templates_draw(array('context' => 'databox', 'name' => gettext("Some text input"), 'column1' => display_input_field(array("blank", "", "text")), 'column2' => run("display:access_level_select", array("blank", "PUBLIC"))));
$body .= templates_draw(array('context' => 'databox1', 'name' => gettext("Some longer text input"), 'column1' => display_input_field(array("blank", "", "longtext"))));
$body .= templates_draw(array('context' => 'databoxvertical', 'name' => gettext("Further text input"), 'contents' => display_input_field(array("blank", "", "longtext")) . "<br />" . display_input_field(array("blank", "", "text")) . "<br /><input type='button' value='Button' />"));
$run_result .= templates_draw(array('context' => 'contentholder', 'title' => $name, 'body' => $body, 'submenu' => ''));
    $comm_name = $_SESSION['comm_name'];
}
$comm_username = '';
if (isset($_SESSION['comm_username'])) {
    $comm_username = $_SESSION['comm_username'];
}
global $page_owner, $CFG, $USER;
if (logged_on && $page_owner == $_SESSION['userid'] && ($CFG->community_create_flag == "" || user_flag_get($CFG->community_create_flag, $USER->ident))) {
    $title = __gettext("Create a new community");
    // gettext variable
    $communityName = __gettext("Community name:");
    // gettext variable
    $buttonValue = __gettext("Create");
    // gettext variable
    $description = __gettext("Description:");
    // gettext variable
    $email = __gettext("Email -- Optional:");
    // gettext variable
    $city = __gettext("City -- Optional:");
    // gettext variable
    /*$fields = templates_draw(array('context' => 'databox1',
             'name' => $communityName,
             'column1' => "<input type=\"text\" name=\"comm_name\" value=\"$comm_name\" size=\"50\"/>"
             )
      );*/
    $fields .= templates_draw(array('context' => 'databox1', 'name' => $communityName, 'column1' => display_input_field(array("comm_name", "", "text"))));
    $fields .= templates_draw(array('context' => 'databox1', 'name' => $description, 'column1' => display_input_field(array("comm_description", "", "mediumtext"))));
    $fields .= templates_draw(array('context' => 'databox1', 'name' => $email, 'column1' => display_input_field(array("comm_email", "", "text"))));
    $fields .= templates_draw(array('context' => 'databox1', 'name' => $city, 'column1' => display_input_field(array("comm_city", "", "text"))));
    $run_result .= templates_draw(array('context' => "community_create", 'title' => $title, 'form_fields' => $fields, 'button' => $buttonValue));
}
Example #6
0
<?php

// Ask for details to invite a friend
$run_result .= <<<END

        <form action="" method="post">

END;
$run_result .= templates_draw(array('context' => 'databox1', 'name' => __gettext("Their name"), 'column1' => display_input_field(array("invite_name", "", "text"))));
$run_result .= templates_draw(array('context' => 'databox1', 'name' => __gettext("Their email address"), 'column1' => display_input_field(array("invite_email", "", "text"))));
$run_result .= templates_draw(array('context' => 'databox1', 'name' => __gettext("An optional message"), 'column1' => display_input_field(array("invite_text", "", "mediumtext"))));
$run_result .= "<p align='center'><input type=\"submit\" value=\"" . __gettext("Invite") . "\" /></p>";
$run_result .= <<<END

            <input type="hidden" name="action" value="invite_invite" />
        </form>

END
;
Example #7
0
function folio_page_edit($page, $permissions, $page_title, $username, $parentpage_ident = -1)
{
    global $CFG;
    global $profile_id;
    global $language;
    global $page_owner;
    global $metatags;
    if (!$page && !isloggedin()) {
        // We don't allow non-logged in users to create new pages
        error('You can not create a new page without logging in.');
    } elseif (!$page) {
        // Set values for the new page.
        // @TODO: Find a better random method, or at least verify that the page doesn't already exist.
        // Generate a new value for the page key.
        // If we change this, also update the stuff in lib that creates a new record.
        $page_ident = rand(1, 999999999);
        // If this page is being created because of a hyperlink, then we
        //	already know what it should be named.  If not, then
        //	set to something that obviously needs to be changed.
        if (!strlen($page_title) > 0) {
            $title = 'New Page Title';
        } else {
            $title = $page_title;
        }
        $body = 'Create your new page here!';
        // Translate passed username into a user ident.
        $user_ident = folio_finduser($username);
        if (!$user_ident) {
            error('mod\\folio\\control\\page_edit.php was called without a username parameter ' . "or with an invalid one ({$username})");
        }
        $user_ident = $user_ident->ident;
        $page = new StdClass();
        $page->page_ident = $page_ident;
        $page->title = $title;
        $page->body = $body;
        $page->security_ident = $page_ident;
        $page->parentpage_ident = $parentpage_ident;
        $page->user_ident = $user_ident;
        $username = $username;
    } else {
        // Clean DB Entries, making them suitable for displaying.
        $page_ident = intval($page->page_ident);
        $body = stripslashes($page->body);
        $title = stripslashes($page->title);
        $parentpage_ident = intval($page->parentpage_ident);
        $security_ident = intval($page->security_ident);
        $user_ident = intval($page->user_ident);
    }
    // Include javascript for the tinymce rich editor.
    // Lose the trailing slash
    $url = substr(url, 0, -1);
    //get current language
    if (empty($CFG->userlocale)) {
        $lang = substr($CFG->defaultlocale, 0, 2);
    } elseif (is_array($CFG->userlocale)) {
        $lang = substr($CFG->userlocale[0], 0, 2);
    } else {
        $lang = substr($CFG->userlocale, 0, 2);
    }
    $metatags .= <<<END
\t\t<SCRIPT type="text/javascript" src="{$url}/mod/folio/control/yav1_2_3/js_compact/yav.js"></SCRIPT>
\t\t<SCRIPT type="text/javascript" src="{$url}/mod/folio/control/yav1_2_3/js_compact/yav-config.js"></SCRIPT>
\t    <script language="javascript" type="text/javascript" src="{$url}/_tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
\t\t
\t    <script language="javascript" type="text/javascript">
\t\t    tinyMCE.init({
\t\t    // General options
\t\t\tmode : "exact",
\t\t\telements : "page_body",
\t\t\tplugins : "safari,pagebreak,table,save,advhr,advimage,emotions,iespell,inlinepopups,media,paste,fullscreen,visualchars,nonbreaking,blockquote",
\t\t\tlanguage : "{$lang}",
\t\t\tconvert_urls : false,
\t\t\trelative_urls : false,
\t\t\tapply_source_formatting : false,
\t\t\tremove_linebreaks : true,
\t\t\tgecko_spellcheck : true,
\t\t\tspellchecker_languages : "+English=en,Dutch=nl,German=de,Spanish=es,Danish=dk,Swedish=sv,French=fr,Japanese=jp",
\t\t\t//script should be a default element according to the docs, but doesn"t appear to work
\t\t\textended_valid_elements : "script[language|src|type],iframe[*]",
\t\t\t//the following shouldn"t be necessary, but seems to be due to some sort of tinymce bug
\t\t\tcustom_elements : "script,iframe",
\t\t\t
\t\t    // Theme options
\t\t    theme : 'advanced',
\t\t\ttheme_advanced_buttons1 : "fontselect,fontsizeselect,bold,italic,underline,strikethrough,sub,sup,separator,link,unlink,image,code,fullscreen",
\t\t    theme_advanced_buttons2 : "justifyleft,justifycenter,justifyright,justifyfull,separator,outdent,indent,blockquote,separator,bullist,numlist,separator,forecolor,backcolor,separator,charmap,hr,removeformat,visualaid",
\t\t    theme_advanced_buttons3 : "undo,redo,cut,copy,paste,pastetext,replace,separator,tablecontrols",
\t\t\ttheme_advanced_buttons4 : "",
\t\t\ttheme_advanced_toolbar_location : "top",
\t\t\ttheme_advanced_toolbar_align : "left",
\t\t\ttheme_advanced_statusbar_location : "bottom",
\t\t\ttheme_advanced_resizing : true,
\t\t\ttheme_advanced_source_editor_width : "500",
\t    \ttheme_advanced_source_editor_height : "380"
\t\t    
    });
\t</script>

<SCRIPT>
    var rules=new Array();
    rules[0]='page_title|regexp|^([A-Za-z0-9-_ ()]+)\$|The Page title can only contain the following characters: ()-_';
</SCRIPT>
<script language="javascript" type="text/javascript">
    function addFile(form) {
        if (form.weblog_add_file.selectedIndex != '') {
            form.page_body.value = form.page_body.value + '{{file:' + form.weblog_add_file.options[form.weblog_add_file.selectedIndex].value + '}}';    
\t\t\ttinyMCE.execCommand('mceInsertContent',true,'{{file:' + form.weblog_add_file.options[form.weblog_add_file.selectedIndex].value + '}}');
\t\t}
    }
</script>

END;
    // Restore the trailing slash in $url
    $url = url;
    $run_result = <<<END
    
<form method="post" name="elggform" action="{$url}_folio/action_redirection.php" onsubmit="return performCheck('elggform', rules, 'classic');">

\t<h2>{$page_title}</h2>
END;
    $run_result .= templates_draw(array('context' => 'databoxvertical', 'name' => 'Title', 'contents' => "<input type=text id='page_title' value='{$title}' name='page_title' style='width: 80%' />"));
    $run_result .= templates_draw(array('context' => 'databoxvertical', 'name' => '', 'contents' => display_input_field(array("page_body", stripslashes($body), "weblogtext"))));
    if (logged_on) {
        $sitename = sitename;
        $filelist = viewfolder(-1, $_SESSION['userid'], 0);
        $run_result .= <<<END
            <p>
      \t\t\tEmbed a file from your {$sitename} file storage:<br />
                <select name="weblog_add_file" id="weblog_add_file">
                    {$filelist}        
                </select>
                <input type="button" value="Add" onclick="addFile(this.form);" /><br />
                (This will add a code to your weblog post that will be converted into an embedded file.)
            </p>
    
END;
    }
    //	if (! stripos($_SERVER['HTTP_USER_AGENT'],"Safari")) //no rich text in Safari - no worky
    $run_result .= <<<END
    <p>
      Embed an external video or other widget:<br />(Copy and paste embed code from external web site)<br />
                <span id="embed"><textarea name="weblog_embed_object" id="weblog_embed_object" rows="3" cols="40"></textarea>
                <input type="button" value="Embed" onclick="tinyMCE.execCommand('mceInsertRawHTML',true,this.form.weblog_embed_object.value);tinyMCE.execCommand('mceCleanup');" /></span>
            </p>
END;
    $run_result .= <<<END
\t<p>
\t\t<input type="hidden" name="action" value="folio:page:update" />
\t\t<input type="hidden" name="username" value="{$username}" />
\t\t<input type="hidden" name="user_ident" value="{$user_ident}" />
\t\t<input type="hidden" name="page_ident" value="{$page_ident}" />
\t\t<!-- <input type="hidden" name="parentpage_ident" value="{$parentpage_ident}" /> -->
\t\t<input type="submit" value="Save" />
        <INPUT TYPE="button" VALUE="Cancel" onClick="javascript:history.back()">
\t</p>

END;
    // Include security
    $run_result .= folio_control_page_edit_security($page) . folio_control_page_edit_move($page) . '</form>';
    return $run_result;
}
<?php

if (isset($parameter)) {
    $post = $parameter;
    $addComment = gettext("Add a comment");
    // gettext variable
    $accessRes = gettext("Comment visibility:");
    // gettext variable
    $run_result .= <<<END
        
    <form action="" method="post">
    
        <h2>{$addComment}</h2>
    
END;
    $field = display_input_field(array("new_weblog_comment", "", "longtext"));
    if (logged_on) {
        $userid = $_SESSION['userid'];
    } else {
        $userid = -1;
    }
    $field .= <<<END
        
        <input type="hidden" name="action" value="weblogs:comment:add" />
        <input type="hidden" name="post_id" value="{$post->ident}" />
        <input type="hidden" name="owner" value="{$userid}" />
        
END;
    $run_result .= templates_draw(array('context' => 'databox1', 'name' => gettext("Your comment text"), 'column1' => $field));
    if (logged_on) {
        $comment_name = $_SESSION['name'];
$action = optional_param('action');
$redirect = url . "mod/messages/messages_actions.php?action=compose";
// Initializing the label messages
$addMsg = __gettext("New message");
$from = __gettext("From:");
$to = __gettext("To:");
$subject = __gettext("Subject:");
$message = __gettext("Message:");
$submitButton = $action == "reply" ? __gettext("Reply") : __gettext("Send");
$run_result = <<<END
<form method="post" name="elggform" action="{$redirect}" onsubmit="return submitForm();">
    <input type="hidden" name="new_msg_from" value="{$from_param_id}"/>
    <h2>{$addMsg}</h2>
END;
$run_result .= templates_draw(array('context' => 'databoxvertical', 'name' => $from, 'contents' => $from_param_name));
// @todo Mirar como se hace lo de los selects usando las funciones de ellos o si hay que hacerlo a manoplas
if (is_array($to_param)) {
    $run_result .= templates_draw(array('context' => 'databoxvertical', 'name' => $to, 'contents' => display_input_field(array("new_msg_to", "", "as_select", null, null, null, $to_param))));
} else {
    $run_result .= "<input type=\"hidden\" name=\"new_msg_to\" value=\"{$to_param_id}\">";
    $run_result .= templates_draw(array('context' => 'databoxvertical', 'name' => $to, 'contents' => $to_param));
}
$run_result .= templates_draw(array('context' => 'databoxvertical', 'name' => $subject, 'contents' => display_input_field(array("new_msg_subject", $subject_param, "text"))));
$run_result .= templates_draw(array('context' => 'databoxvertical', 'name' => $message, 'contents' => display_input_field(array("new_msg_body", stripslashes($msg), "weblogtext"))));
$run_result .= <<<END
    <p>
        <input type="submit" value="{$submitButton}" />
    </p>
</form>
END
;
<?php

// backwards compatibility
if (isset($parameter)) {
    $run_result .= display_input_field($parameter);
}
Example #11
0
        if ($IsCreateAccount) {
            if (!$IsGuest) {
                if ($customers_password == EMPTY_STRING) {
                    if (!$IsUserMode) {
                        require_once DIR_FS_INC . 'olc_create_password.inc.php';
                        $customers_password = olc_RandomString(8);
                        //olc_create_password(8);
                        $cInfo->customers_password = $customers_password;
                    }
                }
                display_input_field('INPUT_PASSWORD', true, EMPTY_STRING, ENTRY_PASSWORD, EMPTY_STRING, 'customers_password', $cInfo->customers_password, MAX_LENGTH, MAX_SIZE, EMPTY_STRING, $error, $entry_password_error, ENTRY_PASSWORD_ERROR, EMPTY_STRING);
            }
            if ($IsUserMode) {
                $smarty->assign('CHECKBOX_NEWSLETTER', olc_draw_checkbox_field('newsletter', '1') . ENTRY_NEWSLETTER_TEXT);
                if (!$IsGuest) {
                    display_input_field('INPUT_CONFIRMATION', true, EMPTY_STRING, ENTRY_PASSWORD_CONFIRMATION, EMPTY_STRING, 'customers_password_confirmation', $customers_password_confirmation, MAX_LENGTH, MAX_SIZE, EMPTY_STRING, $error, $entry_password_confirmation_error, ENTRY_PASSWORD_ERROR_NOT_MATCHING, EMPTY_STRING);
                }
            } else {
                $field_desc_width = 300;
                //EMPTY_STRING;	//
                display_pulldown_menu(EMPTY_STRING, ENTRY_CUSTOMERS_STATUS, $field_desc_width, 'status', $cInfo->customers_status, $customers_statuses_array, $error, 0, EMPTY_STRING);
                if (!$error) {
                    $customers_send_mail = YES;
                }
                display_radio_field(EMPTY_STRING, ENTRY_MAIL, $field_desc_width, 'customers_mail', array('yes', 'no'), array(YES, NO), $customers_send_mail, $error, $entry_mail_error, ENTRY_MAIL_ERROR, EMPTY_STRING);
                echo field_start(ENTRY_MAIL_COMMENTS, $field_desc_width, EMPTY_STRING, EMPTY_STRING) . olc_draw_textarea_field('mail_comments', 'soft', '60', '5', $mail_comments) . '</td>
		</tr>';
            }
        } else {
            display_pulldown_menu(EMPTY_STRING, ENTRY_NEWSLETTER, EMPTY_STRING, 'customers_newsletter', $cInfo->customers_newsletter, $newsletter_array, NOT_REQUIRED, 0, EMPTY_STRING);
            include DIR_WS_MODULES . FILENAME_CUSTOMER_MEMO;
END;
$body .= run("display:access_level_select", array("new_folder_access", default_access));
$keywords = __gettext("Keywords (comma separated):");
// gettext variable
$body .= <<<END
                </p></td>
            </tr>
            <tr>
                <td><p>
                    <label for="new_folder_keywords">
                        {$keywords}
                    </label>
                </p></td>
                <td><p>
END;
$body .= display_input_field(array("new_folder_keywords", "", "keywords", "folder"));
$create = __gettext("Create");
// gettext variable
$body .= <<<END
                </p></td>
            </tr>
            <tr>
                <td colspan="2" align="center"><p>
                    <input type="hidden" name="folder" value="{$folder}" />
                    <input type="hidden" name="files_owner" value="{$page_owner}" />
                    <input type="hidden" name="action" value="files:createfolder" />
                    <input type="hidden" name="new_folder_type" value= {$folderType} />
                    <input type="submit" value={$create} /></p>
                </td>
            </tr>
        </table>
Example #13
0
function widget_text_widget_edit($widget)
{
    global $CFG, $page_owner;
    $widget_text_title = widget_get_data("widget_text_title", $widget->ident);
    $widget_text_body = widget_get_data("widget_text_body", $widget->ident);
    $body = "<h2>" . gettext("Text box") . "</h2>";
    $body .= "<p>" . gettext("This widget displays the text content of your choice. All you need to do is enter the title and body below:") . "</p>";
    $body .= "<p>" . display_input_field(array("widget_data[widget_text_title]", $widget_text_title, "text")) . "</p>";
    $body .= "<p>" . display_input_field(array("widget_data[widget_text_body]", $widget_text_body, "longtext")) . "</p>";
    return $body;
}
    $nope = __gettext('The site administrator has disabled password changing.');
    $run_result .= '<p>' . $nope . '</p>';
} else {
    // Join
    $sitename = sitename;
    $desc = sprintf(__gettext("To generate a new password at %s!, enter your email or email below. We will send the address of a unique verification page to you via email click on the link in the body of the message and a new password will be sent to you."), $sitename);
    // gettext variable
    $thismethod = __gettext("This method reduces the chance of a mistakenly reset password.");
    $run_result .= <<<END

    <p>
        {$desc}
    </p>
    <p>
        {$thismethod}
    </p>
    <form action="" method="post">

END;
    $run_result .= templates_draw(array('context' => 'databoxvertical', 'name' => __gettext("Your email"), 'contents' => display_input_field(array("password_request_email", "", "text"))));
    $request = __gettext("Request new password");
    // gettext variable
    $run_result .= <<<END
            <p align="center">
                <input type="hidden" name="action" value="invite_password_request" />
                <input type="submit" value={$request} />
            </p>
        </form>

END;
}
Example #15
0
 function editfield_display($field)
 {
     // copy array element with default to ''
     $flabel = !empty($field[0]) ? $field[0] : '';
     $fname = !empty($field[1]) ? $field[1] : '';
     $ftype = !empty($field[2]) ? $field[2] : '';
     $fblurb = !empty($field[3]) ? $field[3] : '';
     global $page_owner;
     global $data;
     global $CFG;
     $run_result = '';
     if (empty($flabel) && empty($fname)) {
         return '';
     }
     if (!isset($data['profile:preload'][$flabel])) {
         if (!($value = get_record('profile_data', 'name', $fname, 'owner', $page_owner))) {
             $value = "";
             $value->value = "";
             $value->access = $CFG->default_access;
         }
     } else {
         $value = "";
         $value->value = $data['profile:preload'][$fname];
         $value->access = $CFG->default_access;
     }
     $name = "<label for=\"{$fname}\"><b>{$flabel}</b>";
     if (!empty($fblurb)) {
         $name .= "<br /><i>" . $fblurb . "</i>";
     }
     $name .= '</label>';
     if (empty($ftype)) {
         $ftype = "text";
     }
     $column1 = display_input_field(array("profiledetails[" . $fname . "]", $value->value, $ftype, $fname, @$value->ident, $page_owner));
     $column2 = "<label>" . gettext("Access Restriction:") . "<br />";
     $column2 .= run("display:access_level_select", array("profileaccess[" . $fname . "]", $value->access)) . "</label>";
     $run_result .= templates_draw(array('context' => 'databox', 'name' => $name, 'column1' => $column1, 'column2' => $column2));
     return $run_result;
 }
$body .= run("weblog:posts:extrafield", array($extensionContext, $extraField, $extraValue, $extraSelected));
// Add the fields before the post textarea
//$body .= run("weblogs:posts:add:fields:before",array($_SESSION['userid'],$post));
$body .= run("weblogs:posts:add:fields:before", array($page_owner, $post));
// Add the weblog toolbar
$buttons = run("display:content:toolbar");
if (!empty($buttons)) {
    $body .= $buttons;
}
$body .= templates_draw(array('context' => 'databoxvertical', 'name' => $postBody, 'contents' => display_input_field(array("new_weblog_post", stripslashes($post->body), "weblogtext"))));
// Add the fields after the post textarea
//$body .= run("weblogs:posts:add:fields:after",array($_SESSION['userid'],$post));
$body .= run("weblogs:posts:add:fields:after", array($page_owner, $post));
if (!empty($extraField) && !empty($extraValue)) {
    $body .= templates_draw(array('context' => 'databox', 'name' => $Keywords, 'column1' => "<i>{$keywordDesc}</i>", 'column2' => display_input_field(array("edit_weblog_keywords", $keywords, "mediumtext", "weblog", $post->ident))));
} else {
    $body .= templates_draw(array('context' => 'databox', 'name' => $Keywords, 'column1' => "<i>{$keywordDesc}</i>", 'column2' => display_input_field(array("edit_weblog_keywords", "", "keywords", "weblog", $post->ident))));
}
$body .= templates_draw(array('context' => 'databoxvertical', 'name' => $accessRes, 'contents' => run("display:access_level_select", array("edit_weblog_access", $post->access))));
//$body .= run("weblogs:posts:edit:fields",array($_SESSION['userid'], $post->ident));
$body .= <<<END
    <p align="center">
        <input type="hidden" name="action" value="weblogs:post:edit" />
        <input type="hidden" name="edit_weblog_post_id" value="{$post->ident}" />
        <input type="hidden" name="extension" value="{$extensionContext}" />
        <input type="submit" value="{$postButton}" />
    </p>

</form>
END;
$run_result .= $body;
Example #17
0
    // gettext variable
    $partFour = gettext("When you fill in the details below, we will send an \"invitation code\" to your email address in order to validate it. You must then click on this within seven days to create your account.");
    // gettext variable
    $run_result .= <<<END
                
    <p>
        {$partOne}
    </p>
    <ul>
        <li><a href="{$CFG->wwwroot}content/terms.php" target="_blank">{$sitename} {$terms}</a></li>
        <li><a href="{$CFG->wwwroot}content/privacy.php" target="_blank">{$privacy}</a></li>
    </ul>
    <p>
        {$partFour}
    </p>
    <form action="" method="post">
                
END;
    $run_result .= templates_draw(array('context' => 'databoxvertical', 'name' => gettext("Your name"), 'contents' => display_input_field(array("invite_name", "", "text"))));
    $run_result .= templates_draw(array('context' => 'databoxvertical', 'name' => gettext("Your email address"), 'contents' => display_input_field(array("invite_email", "", "text"))));
    $buttonValue = gettext("Register");
    $run_result .= <<<END
            <p align="center">
                <input type="hidden" name="invite_text" value="" />
                <input type="hidden" name="action" value="invite_invite" />
                <input type="submit" value={$buttonValue} />
            </p>
        </form>
                
END;
}
Example #18
0
<?php

global $USER, $CFG;
// Users panel
if (logged_on && run("users:flags:get", array("admin", $USER->ident))) {
    $run_result .= "<p>" . gettext("Add regular expressions below, one per line, to block spam. For example, 'foo' will block all comments containing the word foo, (foo|bar) will block comments containing the word foo or bar.") . "</p>";
    $run_result .= "<p>" . gettext("Blank lines and lines starting with # will be ignored.") . "</p>";
    if ($spam = get_record('datalists', 'name', 'antispam')) {
        $spam = htmlspecialchars(stripslashes($spam->value), ENT_COMPAT, 'utf-8');
        $spam = str_replace("&amp;", "&", $spam);
        //add & characters back in for valid regex
    } else {
        $spam = "";
    }
    $run_result .= "<form action=\"\" method=\"post\">";
    $run_result .= templates_draw(array('context' => 'databox', 'name' => gettext("Regular expressions"), 'column1' => display_input_field(array("antispam", $spam, "longtext", "antispam")), 'column2' => "<input type=\"hidden\" name=\"action\" value=\"admin:antispam:save\" /><input type=\"submit\" value=\"" . gettext("Save") . "\" />"));
    $run_result .= "</form>";
}
Example #19
0
    </p>
    <ul>
        <li><a href="{$CFG->wwwroot}content/terms.php" target="_blank">{$sitename} {$terms}</a></li>
        <li><a href="{$CFG->wwwroot}content/privacy.php" target="_blank">{$privacy}</a></li>
    </ul>
    <p>
        {$age}
    </p>

    <form action="" method="post">
                
END;
        $run_result .= templates_draw(array('context' => 'databoxvertical', 'name' => gettext("Your name"), 'contents' => display_input_field(array("join_name", $name, "text"))));
        $run_result .= templates_draw(array('context' => 'databoxvertical', 'name' => gettext("Your username - (Must be letters only)"), 'contents' => display_input_field(array("join_username", $username, "text"))));
        $run_result .= templates_draw(array('context' => 'databoxvertical', 'name' => gettext("Enter a password"), 'contents' => display_input_field(array("join_password1", "", "password"))));
        $run_result .= templates_draw(array('context' => 'databoxvertical', 'name' => gettext("Your password again for verification purposes"), 'contents' => display_input_field(array("join_password2", "", "password"))));
        $correctAge = gettext("I am at least thirteen years of age.");
        // gettext variable
        $buttonValue = gettext("Join");
        // gettext variable
        $run_result .= <<<END
            <p align="center">
                <label for="over13checkbox"><input type="checkbox" id="over13checkbox" name="over13" value="yes" /> <strong>{$correctAge}</strong></label>
            </p>
            <p align="center">
                <input type="hidden" name="action" value="invite_join" />
                <input type="submit" value="{$buttonValue}" />
            </p>
        </form>
                
END;
Example #20
0
$body .= run("display:access_level_select", array("new_file_access", default_access));
$keywords = gettext("Keywords (comma separated):");
// gettext variable
$body .= <<<END
                </p></td>
            </tr>
            <tr>
                <td><p>
                    <label for="new_file_keywords">
                        {$keywords}
                    </label>
                    </p>
                </td>
                <td><p>
END;
$body .= display_input_field(array("new_file_keywords", "", "keywords", "file"));
$body .= <<<END
                    </p>
                </td>
            </tr>
END;
$body .= run("metadata:edit");
$copyright = gettext("By checking this box, you are asserting that you have the legal right to share this file, and that you understand you are sharing it with other users of the system.");
//gettext variable
$upload = gettext("Upload");
//gettext variable
$body .= <<<END
            
            <tr>
                <td colspan="2"><p><label for="copyrightokcheckbox">
                    <input type="checkbox" id="copyrightokcheckbox" name="copyright" value="ok" />
function templates_preview()
{
    global $CFG;
    $run_result = '';
    // Preview template
    // Basic page elements
    $name = "Basic page elements";
    $heading1 = __gettext("Heading one");
    // gettext variable
    $heading2 = __gettext("Heading two");
    // gettext variable
    $bulletList = __gettext("A bullet list");
    // gettext variable
    $heading3 = __gettext("Heading three");
    // gettext variable
    $numberedList = __gettext("A numbered list");
    // gettext variable
    $body = <<<END
        
    <img src="{$CFG->wwwroot}mod/template/images/leaves.jpg" width="300" height="225" alt="A test image" align="right" />
    <h1>{$heading1}</h1>
    <p>Paragraph text</p>
    <h2>{$heading2}</h2>
    <ul>
        <li>{$bulletList}</li>
    </ul>
    <h3>{$heading3}</h3>
    <ol>
        <li>{$numberedList}</li>
    </ol>
        
END;
    $run_result .= templates_draw(array('context' => 'contentholder', 'title' => $name, 'body' => $body));
    // Form elements
    $name = "Data input";
    $body = templates_draw(array('context' => 'databox', 'name' => __gettext("Some text input"), 'column1' => display_input_field(array("blank", "", "text")), 'column2' => run("display:access_level_select", array("blank", "PUBLIC"))));
    $body .= templates_draw(array('context' => 'databox1', 'name' => __gettext("Some longer text input"), 'column1' => display_input_field(array("blank", "", "longtext"))));
    $body .= templates_draw(array('context' => 'databoxvertical', 'name' => __gettext("Further text input"), 'contents' => display_input_field(array("blank", "", "longtext")) . "<br />" . display_input_field(array("blank", "", "text")) . "<br /><input type='button' value='Button' />"));
    $run_result .= templates_draw(array('context' => 'contentholder', 'title' => $name, 'body' => $body, 'submenu' => ''));
    return $run_result;
}
<?php

/*
 * Created on Dec 1, 2007
 *
 * @author Diego Andrés Ramírez Aragón <*****@*****.**>
 * @copyright Corporación Somos más - 2007
 */
global $page_owner, $USER, $CFG;
if (isset($parameter)) {
    $selected = $page_owner;
    $field_label = __gettext("Assign to:");
    $options = array();
    $options[$USER->ident] = __gettext("Own");
    if ($communities = get_records_select('users', 'owner = ? AND user_type = ?', array($USER->ident, 'community'))) {
        foreach ($communities as $community) {
            $options[$community->ident] = __gettext("Community") . ": " . $community->name;
        }
    }
    if ($communities = get_records_sql("SELECT u.* FROM " . $CFG->prefix . "friends f\n\t\t                                    JOIN " . $CFG->prefix . 'users u ON u.ident = f.friend 
		                                    WHERE u.user_type = ? AND u.owner <> ? AND f.owner = ?', array('community', $USER->ident, $USER->ident))) {
        foreach ($communities as $community) {
            $options[$community->ident] = __gettext("Community") . ": " . $community->name;
        }
    }
    if ($selected == $USER->ident && count($options) > 1) {
        $run_result .= templates_draw(array('context' => 'databoxvertical', 'name' => $field_label, 'contents' => display_input_field(array('assign_to', $selected, 'select_associative', null, null, null, $options))));
    }
}
Example #23
0
    // Create a new template
    $header = gettext("Create theme");
    // gettext variable
    $desc = gettext("Here you can create your own themes based on one of the existing public themes. Just select which public theme you would like to alter and then create your own. You will now have edit privilages.");
    // gettext variable
    $panel = <<<END
        
        <h2>{$header}</h2>
        <p>{$desc}</p>
        <form action="index.php" method="post">
        
END;
    $panel .= <<<END
        
END;
    $panel .= templates_draw(array('context' => 'databox1', 'name' => gettext("Theme name"), 'column1' => display_input_field(array("new_template_name", "", "text"))));
    $default = gettext("Default Theme");
    // gettext variable
    $column1 = <<<END
        
            <select name="template_based_on">
                <option value="-1">{$default}</option>        
END;
    if ($templates = get_records_select('templates', "owner = ? OR public = ?", array($USER->ident, 'yes'), 'public')) {
        foreach ($templates as $template) {
            $column1 .= "<option value=\"" . $template->ident . "\">" . stripslashes($template->name) . "</option>";
        }
    }
    $column1 .= <<<END
            </select>
END;
$code = trim(optional_param('passwordcode'));
if (!empty($code)) {
    if ($details = get_record_sql('SELECT pr.ident AS passcodeid,u.* FROM ' . $CFG->prefix . 'password_requests pr
                                   JOIN ' . $CFG->prefix . "users u ON u.ident = pr.owner\r\n                                   WHERE pr.code = ? AND u.user_type = ?", array($code, 'person'))) {
        $createpassword = sprintf(__gettext("Please, enter a new Password:"******"" method="post">
\t
END;
        $run_result .= templates_draw(array('context' => 'databoxvertical', 'name' => __gettext("New Password"), 'contents' => display_input_field(array("join_password1", "", "password"))));
        $run_result .= templates_draw(array('context' => 'databoxvertical', 'name' => __gettext("Confirm your new Password"), 'contents' => display_input_field(array("join_password2", "", "password"))));
        $id = $details->ident;
        $email = $details->email;
        $buttonValue = __gettext("Create");
        $run_result .= <<<END
\t\t\t<p align="center">
                <input type="hidden" name="action" value="invite_create_password" />
\t\t\t\t<input type="hidden" name="id" value={$id} />
\t\t\t\t<input type="hidden" name="email" value={$email} />
                <input type="submit" value={$buttonValue} />
            </p>\t\t\t
    </form>
END;
        /*$validcharset = "ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnpqrstuvwxyz234567898765432";
          $newpassword = "";
          for ($i = 0; $i < 8; $i++) {
Example #25
0
<form method="post" name="elggform" action="{$redirect}" onsubmit="return submitForm();">

    <h2>{$addPost}</h2>
    
END;
    $body .= templates_draw(array('context' => 'databoxvertical', 'name' => $postTitle, 'contents' => display_input_field(array("new_weblog_title", $contentTitle, "text"))));
    $body .= templates_draw(array('context' => 'databoxvertical', 'name' => $postBody, 'contents' => display_input_field(array("new_weblog_post", $contentBody, "weblogtext"))));
    $body .= run("weblogs:posts:edit:fields:files", $_SESSION['userid']);
    //    if (! stripos($_SERVER['HTTP_USER_AGENT'],"Safari")) //no rich text in Safari - no worky
    $body .= <<<END
    <p>
      Embed an external video or other widget:<br />(Copy and paste embed code from external web site)<br />
                <span id="embed"><textarea name="weblog_embed_object" id="weblog_embed_object" rows="3" cols="40"></textarea>
                <input type="button" value="Embed" onclick="tinyMCE.execCommand('mceInsertRawHTML',true,this.form.weblog_embed_object.value);tinyMCE.execCommand('mceCleanup');" /></span>
            </p>
END;
    $body .= templates_draw(array('context' => 'databoxvertical', 'name' => $Keywords . "<br />" . $keywordDesc, 'contents' => display_input_field(array("new_weblog_keywords", "", "keywords", "weblog"))));
    $body .= templates_draw(array('context' => 'databoxvertical', 'name' => $accessRes, 'contents' => run("display:access_level_select", array("new_weblog_access", default_access))));
    $body .= run("weblogs:posts:add:fields", $_SESSION['userid']);
    $body .= <<<END
    <p>
        <input type="hidden" name="action" value="weblogs:post:add" />
        <input type="submit" value="{$postButton}" />
    </p>

</form>
END;
} else {
    $run_result .= "<p>" . gettext("You must be logged in to post a new weblog entry. You may do so using the login pane to the right of the screen.") . "</p>";
}
$run_result .= $body;
if (sizeof($parameter) >= 2) {
    if (!isset($data['profile:preload'][$parameter[1]])) {
        if (!($value = get_record('profile_data', 'name', $parameter[1], 'owner', $page_owner))) {
            $value = new StdClass();
            $value->value = null;
            $value->ident = null;
            $value->access = default_access;
        }
    } else {
        unset($value);
        $value->value = $data['profile:preload'][$parameter[1]];
        $value->access = default_access;
    }
    $name = <<<END
                    <label for="{$parameter[1]}">
                        <b>{$parameter[0]}</b>
END;
    if (isset($parameter[3])) {
        $name .= "<br /><i>" . $parameter[3] . "</i>";
    }
    $name .= <<<END
                    </label>
END;
    if (sizeof($parameter) < 3) {
        $parameter[2] = "text";
    }
    $column1 = display_input_field(array("profiledetails[" . $parameter[1] . "]", $value->value, $parameter[2], $parameter[1], $value->ident, $page_owner));
    $column2 = "<label>" . __gettext("Access Restriction:") . "<br />";
    $column2 .= run("display:access_level_select", array("profileaccess[" . $parameter[1] . "]", $value->access)) . "</label>";
    $run_result .= templates_draw(array('context' => 'databox', 'name' => $name, 'column1' => $column1, 'column2' => $column2));
}
END;
        $body .= run("display:access_level_select", array("edit_folder_access", $folder_details->access));
        $keywords = __gettext("Keywords (comma separated):");
        // gettext variable
        $body .= <<<END
                </p></td>
            </tr>
            <tr>
                <td><p>
                    <label for="edit_folder_access">
                        {$keywords}
                    </label>
                </td></p>
                <td><p>
END;
        $body .= display_input_field(array("edit_folder_keywords", "", "keywords", "folder", $this_folder));
        $save = __gettext("Save");
        // gettext variable
        $body .= <<<END
                </p></td>
            </tr>
            <tr>
                <td colspan="2" align="center"><p>
                    <input type="hidden" name="action" value="edit_folder" />
                    <input type="hidden" name="edit_folder_id" value="{$this_folder}" />
                    <input type="submit" value={$save} /></p>
                </td>
            </tr>
        </table>
    </form>
END;