function login_form() { global $vars, $phpc_script; $submit_data = tag('td', attributes('colspan="2"'), create_hidden('action', 'login'), create_submit(__('Log in'))); if (!empty($vars['lasturl'])) { $submit_data->prepend(create_hidden('lasturl', escape_entities(urlencode($vars['lasturl'])))); } return tag('form', attributes("action=\"{$phpc_script}\"", 'method="post"'), tag('table', tag('caption', __('Log in')), tag('thead', tag('tr', tag('th', attributes('colspan="2"'), __('You must have cookies enabled to login.')))), tag('tfoot', tag('tr', $submit_data)), tag('tbody', tag('tr', tag('th', __('Username')), tag('td', create_text('username'))), tag('tr', tag('th', __('Password')), tag('td', create_password('password')))))); }
function soft_error($message) { throw new Exception(escape_entities($message)); }
function userMenu() { global $action, $phpc_user; if (is_user()) { $welcome = __('Welcome') . ' ' . $phpc_user->username; } else { $welcome = ""; } $span = tag('span'); $html = tag('div', attrs('class="phpc-logged ui-widget-content"'), $welcome, $span); if ($action != 'user_settings') { menu_item_append($span, __('Settings'), 'user_settings'); } if (is_user()) { menu_item_append($span, __('Log out'), 'logout', array('lasturl' => escape_entities(urlencode($_SERVER['QUERY_STRING'])))); } else { menu_item_append($span, __('Log in'), 'login', array('lasturl' => escape_entities(urlencode($_SERVER['QUERY_STRING'])))); } return $html; }
function field_list() { global $phpc_script, $phpcid, $phpc_cal, $vars; $tbody = tag('tbody'); $have_contents = false; foreach ($phpc_cal->get_fields() as $field) { $have_contents = true; $name = empty($field['name']) ? __('No Name') : $field['name']; $fid = $field['fid']; $tbody->add(tag('tr', tag('td', $name), tag('td', escape_entities($field['required'])), tag('td', escape_entities($field['format'])), tag('td', create_action_link(__('Edit'), 'field_form', array('fid' => $fid)), " ", create_action_link(__('Delete'), 'field_delete', array('fid' => $fid), attrs('class="phpc-confirm-field"'))))); } if (!$have_contents) { $tbody->add(tag('tr', tag('td', attrs('colspan=4'), __('No fields.')))); } $table = tag('table', attrs('class="phpc-container"'), tag('thead', tag('tr', attrs('class="ui-widget-header"'), tag('th', __('Name')), tag('th', __('Required?')), tag('th', __('Format')), tag('th', __('Actions')))), $tbody); $dialog = tag('div', attrs('id="phpc-dialog-field"', 'title="' . __("Confirmation required") . '"'), __("Permanently delete this field?")); return tag('div', attrs('id="phpc-fields"'), tag('div', attrs('class="phpc-sub-title"'), __('Calendar Fields')), $dialog, $table, create_action_link(__('Create Field'), 'field_form', array('cid' => $phpcid), attrs('class="phpc-button"'))); }