function SitepresenterAddForm() { parent::MailForm(); global $page, $cgi; $this->parseSettings('inc/app/sitepresenter/forms/add/settings.php'); page_title(intl_get('Adding Presentation')); loader_import('ext.phpsniff'); $sniffer = new phpSniff(); $this->_browser = $sniffer->property('browser'); // include formhelp, edit panel init, and cancel handler page_add_script(site_prefix() . '/js/formhelp.js'); page_add_script(CMS_JS_FORMHELP_INIT); page_onload('cms_init_edit_panels ()'); page_add_script(' function cms_cancel (f) { if (arguments.length == 0) { window.location.href = "/index/cms-app"; } else { if (f.elements["_return"] && f.elements["_return"].value.length > 0) { window.location.href = f.elements["_return"].value; } else { window.location.href = "/index/sitepresenter-app"; } } return false; } '); // add cancel handler $this->widgets['submit_button']->buttons[1]->extra = 'onclick="return cms_cancel (this.form)"'; }
function onSubmit($vals) { page_onload(false); page_onclick(false); page_onfocus(false); echo '<ul><li><a href="#rendered">Rendered HTML</a></li><li><a href="#source">HTML Source</a></li><li><a href="xed-example-form">Back</a></li></ul>'; echo '<a name="rendered"></a><h2>Rendered HTML:</h2><div style="border: #369 1px dashed; padding: 10px; width: 600px">'; echo $vals['xeditor']; echo '<br clear="all" /></div><p><a href="#top">[ top ]</a></p><a name="source"></a><h2>HTML Source:</h2><div style="border: #369 1px dashed">'; echo '<pre>' . htmlentities($vals['xeditor']) . '</pre></div>'; }
function SitestudyEditForm() { parent::MailForm(); $this->parseSettings('inc/app/sitestudy/forms/edit/settings.php'); global $page, $cgi; page_title(intl_get('Editing Case Study') . ': ' . $cgi->_key); loader_import('ext.phpsniff'); $sniffer = new phpSniff(); $this->_browser = $sniffer->property('browser'); // include formhelp, edit panel init, and cancel handler page_add_script(site_prefix() . '/js/formhelp.js'); page_add_script(CMS_JS_FORMHELP_INIT); page_onload('cms_init_edit_panels ()'); page_add_script(' function cms_cancel_unlock (f, collection, key) { if (arguments.length == 0) { window.location.href = "' . site_prefix() . '/index/cms-unlock-action?collection=" + collection + "&key=" + key + "&return=' . site_prefix() . '/index/cms-app"; } else { if (f.elements[\'_return\'] && f.elements[\'_return\'].value.length > 0) { window.location.href = "' . site_prefix() . '/index/cms-unlock-action?collection=" + collection + "&key=" + key + "&return=" + f.elements[\'_return\'].value; } else { window.location.href = "' . site_prefix() . '/index/cms-unlock-action?collection=" + collection + "&key=" + key + "&return=' . site_prefix() . '/index/news-app"; } } return false; } '); // add cancel handler $this->widgets['submit_button']->buttons[1]->extra = 'onclick="return cms_cancel_unlock (this.form, \'' . $cgi->_collection . '\', \'' . $cgi->_key . '\')"'; // get copy from repository loader_import('cms.Versioning.Rex'); $rex = new Rex($cgi->_collection); $_document = $rex->getCurrent($cgi->_key); // set values from repository entry foreach (get_object_vars($_document) as $k => $v) { if (is_object($this->widgets[$k])) { $this->widgets[$k]->setValue($v); } } }
return; } global $cgi; if (isset($cgi->username)) { sleep(2); } loader_import('cms.Workflow'); if (!session_admin() && isset($cgi->username)) { echo Workflow::trigger('error', array('message' => 'Failed login attempt')); } elseif (session_admin()) { Workflow::trigger('login', array('message' => 'User: '******'username' => session_username())); } // admin check if (!session_admin()) { page_title(intl_get('Welcome to') . ' ' . PRODUCT_SHORTNAME); page_onload("document.getElementById('username').focus ()"); if (isset($cgi->username)) { echo '<p>' . intl_get('Invalid login. Please try again.') . '</p>'; } else { echo '<p>' . intl_get('Please login to begin your session.') . '</p>'; } echo template_simple('<form method="post" action="{site/prefix}/index/cms-app" target="_top"> <input type="hidden" name="forward" value="{filter base64_decode}{cgi/forward}{end filter}" /> <table cellpadding="5" border="0"> <tr> <td>{intl Username}</td> <td><input type="text" name="username" id="username" /></td> </tr> <tr> <td>{intl Password}</td> <td><input type="password" name="password" /></td>
function onSubmit($vals) { page_onload(false); page_onclick(false); page_onfocus(false); }
function display($generate_html = 0) { parent::display($generate_html); global $intl, $simple, $cgi; // needs browser check to display textarea as alternative $this->initial_value = $this->formatValue($this->data_value); $this->scroller_data = $this->formatValue($this->scroller_data); if ($this->reference !== false) { if (empty($this->reference)) { $this->reference = '<br />'; } $this->reference = $this->formatValue($this->reference); } loader_import('ext.phpsniff'); $ua = new phpSniff(); if ($ua->property('browser') == 'ie' && $ua->property('platform') == 'win' && $ua->property('version') >= '5.5' || $ua->property('browser') == 'mz' && $ua->property('version') >= '1.3' || $ua->property('browser') == 'ns' && $ua->property('version') >= '5.0' || $ua->property('browser') == 'fb' && $ua->property('version') >= '0.7' || $ua->property('browser') == 'ca' && $ua->property('version') >= '1.0' || $ua->property('browser') == 'sf' && $ua->property('version') >= '522' || strpos($ua->property('ua'), 'adobeair')) { // go xed if ($ua->property('browser') == 'ie') { $this->msie = true; if ($ua->property('version') >= '7.0') { $this->msie7 = 'true'; } } if ($ua->property('browser') == 'sf') { $this->safari = 'true'; } elseif (strpos($ua->property('ua'), 'adobeair')) { $this->safari = 'true'; $this->adobeair = 'true'; } if (@file_exists('inc/html/' . conf('Server', 'default_template_set') . '/images.php')) { if ($cgi->_collection) { $collection = $cgi->_collection; } elseif ($cgi->collection) { $collection = $cgi->collection; } else { $collection = false; } if ($collection) { $images = ini_parse('inc/html/' . conf('Server', 'default_template_set') . '/images.php'); if (isset($images[$collection])) { $this->max_height = $images[$collection]['max_height']; $this->max_width = $images[$collection]['max_width']; if ($images[$collection]['popup']) { $this->img_popup = 'true'; } else { $this->img_popup = 'false'; } } else { $this->max_height = 'false'; $this->max_width = 'false'; $this->img_popup = 'false'; } } else { $this->max_height = 'false'; $this->max_width = 'false'; $this->img_popup = 'false'; } } else { $this->max_height = 'false'; $this->max_width = 'false'; $this->img_popup = 'false'; } // initialize modal dialog event handlers page_onload('xed_init (\'' . $this->name . '\')'); page_onclick('checkModal ()'); page_onfocus('return checkModal ()'); template_bind('/html/body', ' <form style="display: inline" id="xed-' . $this->name . '-fsform" method="post" action="' . site_prefix() . '/index/xed-fullscreen-form" target="xedFullscreenWindow"> <input type="hidden" name="ifname" value="' . $this->name . '" /> <input type="hidden" name="xeditor" value="" /> </form>'); $this->templates = db_fetch_array('select * from xed_templates'); foreach ($this->templates as $k => $t) { $this->templates[$k]->body = $this->formatValue($t->body); } $this->source_height = $this->height + 2; loader_import('saf.GUI.Prompt'); $template = join('', file('inc/app/xed/html/xed.spt')); return template_simple($template, $this); } else { // return a textarea return '<tr><td class="field" colspan="2"><textarea name="' . $this->name . '" cols="50" rows="10">' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '</textarea></td></tr>'; } }