public function echoMenu($items) { foreach ($items as $key => $item) { if (!array_key_exists($item->id, $this->echoed)) { $this->countLevel($item); $this->echoed[$item->id] = $this->level; echo '<tr><td>'; for ($i = 0; $i < $this->echoed[$item->id]; $i++) { echo "--"; } echo " " . $item->id . '</td> <td>' . __(dots($item->title, 90)) . '</td> <td><a class="btn btn-primary" href="' . _l(URL::action('MenuController@getItemEdit') . '/' . $item->id) . '">' . __(Lang::get('admin.edit')) . '</a></td> <td><a href="#" data-toggle="modal" data-target="#confirm-delete" class="btn btn-danger" data-href="' . URL::action('MenuController@getItemDestroy') . '/' . $item->id . '">' . __(Lang::get('admin.delete')) . '</a></td> </tr>'; } if ($item->children()->count() > 0) { $this->echoMenu($item->children); } } }
function edit_note($id) { if ((string) (int) $id != $id) { _die("Invalid ID"); } include "lib/tags.php"; $post_data =& $_POST; foreach (array('ID', 'title', 'contents', 'tags', 'time', 'slug') as $key) { $post_data[$key] = pg_escape_string(@$post_data[$key]); } $post_data['tags'] = clean_tags($post_data['tags']); if (trim($post_data['slug']) == '') { $post_data['slug'] = make_slug($post_data['title']); } if (!($time = strtotime(@$post_data['time']))) { $time = date("Y-m-d H:i:s O", time()); } else { $time = date("Y-m-d H:i:s O", $time); } $result = db("UPDATE public.\"notes\" SET \"title\" = '{$post_data['title']}',\n\t\t\t\"contents\" ='{$post_data['contents']}', \"tags\" = '{$post_data['tags']}',\n\t\t\t\"slug\" ='{$post_data['slug']}'\n\t\t\tWHERE \"ID\" = " . pg_escape_string($id)); if ($result) { if (!rebuild_tags()) { _die("There was an error rebuilding the tag cloud data.\n\t\t\t\t<a href=\"" . _l("/edit/{$id}") . "\">Go back →"); } _die("Edit successfull. <a href=\"" . _l("/edit/{$id}") . "\">continue editing →"); } else { _die("There was an unexpected error."); } }
function tags_linked($str) { $tags = explode(' ', $str); foreach ($tags as $tag) { echo " <a href=\"" . _l("/tag/{$tag}") . "\">{$tag}</a>"; } }
public function show($segments) { extract($_POST); if (!isset($username)) { $username = $segments[1]; } $entry = DB::query('select id,username,title,location,bio,avatar from users where username = \'' . $username . '\'', 1); $entry['activity'] = DB::query('select count(*) as activity from feed where user_id = \'' . $entry['id'] . '\'', 2, 'activity'); if (!is_file(PATH_UPLOAD . 'profile/' . $entry['avatar'])) { $entry['avatar'] = 'default.png'; } $feed = array(); $feedraw = DB::query('select * from feed where user_id = ' . $entry['id'] . ' and privacy_id = 1 order by id desc limit 20', 0); foreach ($feedraw as $i => $row) { $feed[$i] = $row; $feed[$i]['status'] = Feed::parse_status($row['status']); $feed[$i]['files'] = Feed::get_files($row['id'], 'th'); if (isset($row['created_ts'])) { $feed[$i]['timespan'] = timespan($row['created_ts']); } } $follow_btn = ""; if ($entry['id'] != $_SESSION['user_id']) { $following = DB::query('select id from follows where user_id = ' . $_SESSION['user_id'] . ' and user2_id = ' . $entry['id'], 1); if ($following) { $follow_btn = '<button class="btn btn-success follow" data-id="' . $entry['id'] . '"><i class="ion-checkmark-round"></i> ' . _l('Following') . ' </button>'; } else { $follow_btn = '<button class="btn btn-info follow" data-id="' . $entry['id'] . '"><i class="ion-ios-bolt"></i> ' . _l('Follow') . ' </button>'; } } return array('view' => "account", 'follow_btn' => $follow_btn, 'entry' => $entry, 'feed' => $feed); }
/** * {@inheritdoc} */ public function render(ResultRow $values) { $value = $this->getValue($values); if (!empty($this->options['display_as_link'])) { return _l($this->sanitizeValue($value), $value, array('html' => TRUE)); } else { return $this->sanitizeValue($value, 'url'); } }
/** * Tests the Update Manager module when a security update is available. */ function testSecurityUpdateAvailable() { $this->setSystemInfo7_0(); $this->refreshUpdateStatus(array('drupal' => '2-sec')); $this->standardTests(); $this->assertNoText(t('Up to date')); $this->assertNoText(t('Update available')); $this->assertText(t('Security update required!')); $this->assertRaw(_l('7.2', 'http://example.com/drupal-7-2-release'), 'Link to release appears.'); $this->assertRaw(_l(t('Download'), 'http://example.com/drupal-7-2.tar.gz'), 'Link to download appears.'); $this->assertRaw(_l(t('Release notes'), 'http://example.com/drupal-7-2-release'), 'Link to release notes appears.'); }
function set_error($message) { if (!isset($_SESSION['_errors'])) { $_SESSION['_errors'] = array(); } foreach ($_SESSION['_errors'] as $existing_error) { if ($existing_error == _l($message)) { return false; } } $_SESSION['_errors'][] = _l($message); return true; }
public function testFieldUrl() { $view = Views::getView('test_view'); $view->setDisplay(); $view->displayHandlers->get('default')->overrideOption('fields', array('name' => array('id' => 'name', 'table' => 'views_test_data', 'field' => 'name', 'relationship' => 'none', 'display_as_link' => FALSE))); $this->executeView($view); $this->assertEqual('John', $view->field['name']->advancedRender($view->result[0])); // Make the url a link. $view->destroy(); $view->setDisplay(); $view->displayHandlers->get('default')->overrideOption('fields', array('name' => array('id' => 'name', 'table' => 'views_test_data', 'field' => 'name', 'relationship' => 'none'))); $this->executeView($view); $this->assertEqual(_l('John', 'John'), $view->field['name']->advancedRender($view->result[0])); }
function query($sql, $debug_message = '') { if (class_exists('module_db', false) && is_callable('module_db::query')) { return module_db::query($sql, $debug_message); } //echo ''.$sql.'<br>'; if (_DEBUG_MODE && defined('_DEBUG_SQL') && _DEBUG_SQL) { static $past_queries = array(); if (!isset($past_queries[$sql])) { $past_queries[$sql] = 0; } else { $past_queries[$sql]++; } $sql_debug = $sql; if (strlen($sql_debug) > 60) { $sql_debug = htmlspecialchars(substr($sql_debug, 0, 60)) . '<a href="#" onclick="$(this).hide(); $(\'span\',$(this).parent()).show(); return false;">....</a><span style="display:none">' . htmlspecialchars(substr($sql, 60)) . '</span>'; } else { $sql_debug = htmlspecialchars($sql); } if (class_exists('module_debug', false)) { module_debug::log(array('title' => 'SQL Query', 'file' => 'includes/database.php', 'data' => '(' . ($past_queries[$sql] > 0 ? '<span style="color:#FF0000; font-weight:bold;">' . $past_queries[$sql] . '</span>' : $past_queries[$sql]) . ') ' . $debug_message . $sql_debug, 'important' => $past_queries[$sql] > 0)); } } $res = mysql_query($sql); //or die(mysql_error() . $sql); if (mysql_errno()) { set_error(_l('SQL Error: %s', mysql_error() . ' ' . $sql)); set_error(_l('Try clicking the "Run Manual Upgrades" button to resolve SQL Errors.')); return false; } return $res; }
function getDirLinks($url_params, $path, $getvar, $home) { $ret = ''; $dirs = explode('/', $path); $dirpath = ''; $ret .= _l($home, $url_params, array($getvar => '')); foreach ($dirs as $dirname) { if ($dirname) { $ret .= ' » ' . _l($dirname, $url_params, array($getvar => '/' . $dirpath . $dirname)); $dirpath .= $dirname . '/'; } } return $ret; }
public function process() { if ('save_extra_default' == $_REQUEST['_process']) { if (!module_config::can_i('edit', 'Settings')) { die('No perms to save extra field settings.'); } if (isset($_REQUEST['butt_del'])) { if (module_form::confirm_delete('extra_default_id', _l("Really delete this extra field and ALL extra data linked to this field?"), $_SERVER['REQUEST_URI'])) { $extra_default = module_extra::get_extra_default($_REQUEST['extra_default_id']); if ($extra_default && $extra_default['extra_default_id'] == $_REQUEST['extra_default_id'] && $extra_default['owner_table'] && $extra_default['extra_key']) { $extra_values = get_multiple('extra', array('owner_table' => $extra_default['owner_table'], 'extra_key' => $extra_default['extra_key']), 'extra_id', 'exact', 'owner_id'); if ($extra_values) { foreach ($extra_values as $extra_value) { if ($extra_value['owner_table'] == $extra_default['owner_table'] && $extra_value['extra_key'] == $extra_default['extra_key']) { delete_from_db('extra', 'extra_id', $extra_value['extra_id']); } } } } delete_from_db('extra_default', 'extra_default_id', $_REQUEST['extra_default_id']); set_message('Extra field deleted successfully.'); redirect_browser(str_replace('extra_default_id', 'extra_default_id_deleted', $_SERVER['REQUEST_URI'])); } } if ((int) $_REQUEST['extra_default_id'] > 0) { $extra_default = module_extra::get_extra_default($_REQUEST['extra_default_id']); if ($extra_default && $extra_default['extra_default_id'] == $_REQUEST['extra_default_id'] && $extra_default['owner_table'] && $extra_default['extra_key']) { if (isset($_POST['extra_key']) && !empty($_POST['extra_key']) && $_POST['extra_key'] != $extra_default['extra_key']) { // they have renamed the key, rename all the existing ones in the system. $extra_values = get_multiple('extra', array('owner_table' => $extra_default['owner_table'], 'extra_key' => $extra_default['extra_key']), 'extra_id', 'exact', 'owner_id'); if ($extra_values) { foreach ($extra_values as $extra_value) { if ($extra_value['owner_table'] == $extra_default['owner_table'] && $extra_value['extra_key'] == $extra_default['extra_key']) { update_insert('extra_id', $extra_value['extra_id'], 'extra', array('extra_key' => $_POST['extra_key'])); } } } } } } $data = $_POST; if (isset($data['options']) && is_array($data['options'])) { $data['options'] = json_encode($data['options']); } update_insert('extra_default_id', $_REQUEST['extra_default_id'], 'extra_default', $data); set_message('Extra field saved successfully'); redirect_browser($_SERVER['REQUEST_URI']); } }
function print_list($result) { ?> <ul class="archives"> <?php while ($row = pg_fetch_assoc($result)) { $time = strtotime($row['time']); $slug_time = date("y-m-d", $time); $title_time = date("D, m/d h:m:a", $time); echo "\t<li><a title='{$title_time}' href='" . _l("/date/{$slug_time}#{$row['slug']}") . "'>{$row['title']}</a></li>"; } ?> </ul> <?php }
/** * Display a listing of the resource. * * @return Response */ public function getIndex() { if (Session::get('user_level') < Config::get('cms.shopManager')) { return Redirect::to(_l(URL::action('AdminHomeController@getIndex'))); } $this->setLayout(); if (Input::get('q')) { $products = Product::where(function ($query) { $query->where('title', 'LIKE', '%' . Input::get('q') . '%')->orwhere('long_content', 'LIKE', '%' . Input::get('q') . '%')->orwhere('short_content', 'LIKE', '%' . Input::get('q') . '%'); })->orderBy('created_at', 'desc')->paginate(20); } else { $products = News::orderBy('created_at', 'desc')->paginate(20); } View::share('title', __(Lang::get('shop.products'))); View::share('products', $products); $this->layout->content = View::make('backend.shop.product.index'); }
function login() { $username = $this->security->xss_clean($this->input->post('username')); $password = md5($this->input->post('password')); $result = $this->NodCMS_admin_sign_model->check_login($username, $password); $tam = $result->result_array(); if ($result->num_rows() > 0 && ($tam[0]['group_id'] == 1 || $tam[0]['group_id'] == 2)) { foreach ($result->result_array() as $row) { $data = array('fullname' => $row['firstname'] . " " . $row['firstname'], 'username' => $row['username'], 'user_id' => $row['user_id'], 'group' => $row['group_id'], 'avatar' => $row['avatar'], 'email' => $row['email'], 'logged_in_status' => true); } $this->session->set_userdata($data); $_SESSION['Session_Admin'] = $data['user_id']; redirect(base_url() . 'admin/'); } else { $this->session->set_flashdata('message', _l('Oopsie, Username or password is incorrect', $this)); redirect(base_url() . 'admin-sign'); } }
/** * Displays the path administration overview page. * * @param \Symfony\Component\HttpFoundation\Request $request * The request object. * * @return array * A render array as expected by drupal_render(). */ public function adminOverview(Request $request) { $keys = $request->query->get('search'); // Add the filter form above the overview table. $build['path_admin_filter_form'] = $this->formBuilder()->getForm('Drupal\\path\\Form\\PathFilterForm', $keys); // Enable language column if language.module is enabled or if we have any // alias with a language. $multilanguage = $this->moduleHandler()->moduleExists('language') || $this->aliasStorage->languageAliasExists(); $header = array(); $header[] = array('data' => $this->t('Alias'), 'field' => 'alias', 'sort' => 'asc'); $header[] = array('data' => $this->t('System'), 'field' => 'source'); if ($multilanguage) { $header[] = array('data' => $this->t('Language'), 'field' => 'langcode'); } $header[] = $this->t('Operations'); $rows = array(); $destination = drupal_get_destination(); foreach ($this->aliasStorage->getAliasesForAdminListing($header, $keys) as $data) { $row = array(); $row['data']['alias'] = _l(truncate_utf8($data->alias, 50, FALSE, TRUE), $data->source, array('attributes' => array('title' => $data->alias))); $row['data']['source'] = _l(truncate_utf8($data->source, 50, FALSE, TRUE), $data->source, array('alias' => TRUE, 'attributes' => array('title' => $data->source))); if ($multilanguage) { $row['data']['language_name'] = $this->languageManager()->getLanguageName($data->langcode); } $operations = array(); $operations['edit'] = array('title' => $this->t('Edit'), 'url' => Url::fromRoute('path.admin_edit', ['pid' => $data->pid], ['query' => $destination])); $operations['delete'] = array('title' => $this->t('Delete'), 'url' => Url::fromRoute('path.delete', ['pid' => $data->pid], ['query' => $destination])); $row['data']['operations'] = array('data' => array('#type' => 'operations', '#links' => $operations)); // If the system path maps to a different URL alias, highlight this table // row to let the user know of old aliases. if ($data->alias != $this->aliasManager->getAliasByPath($data->source, $data->langcode)) { $row['class'] = array('warning'); } $rows[] = $row; } $build['path_table'] = array('#type' => 'table', '#header' => $header, '#rows' => $rows, '#empty' => $this->t('No URL aliases available. <a href="@link">Add URL alias</a>.', array('@link' => $this->url('path.admin_add')))); $build['path_pager'] = array('#theme' => 'pager'); return $build; }
/** * Tests basic aggregator_item view. */ public function testAggregatorItemView() { $feed = $this->feedStorage->create(array('title' => $this->randomMachineName(), 'url' => 'http://drupal.org/', 'refresh' => 900, 'checked' => 123543535, 'description' => $this->randomMachineName())); $feed->save(); $items = array(); $expected = array(); for ($i = 0; $i < 10; $i++) { $values = array(); $values['fid'] = $feed->id(); $values['timestamp'] = mt_rand(REQUEST_TIME - 10, REQUEST_TIME + 10); $values['title'] = $this->randomMachineName(); $values['description'] = $this->randomMachineName(); // Add a image to ensure that the sanitizing can be tested below. $values['author'] = $this->randomMachineName() . '<img src="http://example.com/example.png" \\>"'; $values['link'] = 'http://drupal.org/node/' . mt_rand(1000, 10000); $values['guid'] = $this->randomString(); $aggregator_item = $this->itemStorage->create($values); $aggregator_item->save(); $items[$aggregator_item->id()] = $aggregator_item; $values['iid'] = $aggregator_item->id(); $expected[] = $values; } $view = Views::getView('test_aggregator_items'); $this->executeView($view); $column_map = array('iid' => 'iid', 'aggregator_item_title' => 'title', 'aggregator_item_timestamp' => 'timestamp', 'aggregator_item_description' => 'description', 'aggregator_item_author' => 'author'); $this->assertIdenticalResultset($view, $expected, $column_map); // Ensure that the rendering of the linked title works as expected. foreach ($view->result as $row) { $iid = $view->field['iid']->getValue($row); $expected_link = _l($items[$iid]->getTitle(), $items[$iid]->getLink(), array('absolute' => TRUE)); $this->assertEqual($view->field['title']->advancedRender($row), $expected_link, 'Ensure the right link is generated'); $expected_author = aggregator_filter_xss($items[$iid]->getAuthor()); $this->assertEqual($view->field['author']->advancedRender($row), $expected_author, 'Ensure the author got filtered'); $expected_description = aggregator_filter_xss($items[$iid]->getDescription()); $this->assertEqual($view->field['description']->advancedRender($row), $expected_description, 'Ensure the author got filtered'); } }
<form class="form"> <div class="field"> <h1 class="label">Upgrade from Kirby 1</h1> <div class="text"> <p> It seems like you are trying to upgrade from Kirby 1. There are just a couple of steps to complete before you can use the new version. </p> <ol> <li>Please move all blueprints from <b>/site/panel/blueprints</b> to <b>/site/blueprints</b></li> <li>Please move all config settings from <b>/site/panel/config/config.php</b> to <b>/site/config/config.php</b></li> <li>Please move all fields from <b>/site/panel/fields</b> to <b>/site/fields</b></li> </ol> </div> </div> <div class="buttons buttons-centered cf"> <input type="submit" name="retry" class="btn btn-rounded btn-submit" value="<?php _l('installation.check.retry'); ?> "> </div> </form>
function doAction($url_params) { if (!$url_params['ryform_name']) { return array(DATA_RYFORM_VALUE, array()); } $ret = ''; $ryforms = explode('/', $url_params['ryform_name']); $this_ryform_name = array_shift($ryforms); list($ryform_name, $ryform_pos) = explode(':', $this_ryform_name); if (!isset($this->defines[$ryform_name])) { return 'Bad ryform name'; } $def = $this->defines[$ryform_name]; if ($ryforms) { $action = 'edit'; $next_action = $url_params['ryform_action']; } else { $action = $url_params['ryform_action']; $next_action = ''; } switch ($action) { case 'list': if (isset($url_params['ryform_parent']) && $url_params['ryform_parent']) { $ryform_parent = $url_params['ryform_parent'] . '/'; } else { $ryform_parent = ''; } $ret .= '<table cellpadding="0" cellspacing="0" width="100%">'; foreach ($def->params as $id => $ryform) { if (is_array($ryform)) { $ret .= _s('t row 1', '<td height="28px" width="22px" bgcolor=' . ryzom_get_color_style('section') . '></td><td bgcolor=' . ryzom_get_color_style('section') . '>' . ryzom_font(_t('ryform_cat_' . $id), '', '12') . '</td><td bgcolor=' . ryzom_get_color_style('section') . '></td>'); foreach ($ryform as $subid => $subryform) { $ret .= _s('t row ' . $subid % 2, '<td width="22px" height="34px">' . self::$ryformsIcons[$subryform] . '</td><td> ' . _l(_t($subryform . '_short_description'), $url_params, array('ryform_name' => $ryform_parent . $url_params['ryform_name'], 'ryform_action' => 'add', 'new_ryform' => $subryform)) . '</td><td>' . $subryform . '</td>'); } } else { $ret .= _s('t row ' . $id % 2, '<td width="22px" height="34px">' . self::$ryformsIcons[$ryform] . '</td><td> ' . _l(_t($ryform . '_short_description'), $url_params, array('ryform_name' => $ryform_parent . $url_params['ryform_name'], 'ryform_action' => 'add', 'new_ryform' => $ryform)) . '</td><td>' . $ryform . '</td>'); } } $ret .= '</table>'; return array(DATA_HTML_FORM, $ret); break; case 'list_multiadd': // TODO /* unset($url_params[$deffullname.'_action']); $ret .= '<table cellpadding="5"><tr>'; foreach ($def->params as $ryform) { $ret .= '<td bgcolor="#000000">'._l($ryform, $url_params, array('ryform_action' => 'multiadd', 'new_ryform' => $ryform)).'</td>'; } $ret .= '</tr></table>'; return array(DATA_HTML_FORM, $ret);*/ break; case 'add': $new_ryform = ryzom_get_param('new_ryform'); $valid_ryform = false; if ($new_ryform) { if (is_string($def->params) && $new_ryform == $def->params || in_array($new_ryform, $def->params)) { $valid_ryform = true; } else { foreach ($def->params as $param) { if (is_array($param) && in_array($new_ryform, $param)) { $valid_ryform = true; } } } if (!$valid_ryform) { return array(DATA_HTML_FORM, 'Bad ryform'); } } else { $new_ryform = $def->params; } $ryform = new $new_ryform($new_ryform, ''); $ryform->preSerialization(); if ($def->type != DEF_TYPE_RYFORM) { p($def->value); if (!is_array($def->value)) { $savedRyform = array($def->value); } else { $savedRyform = $def->value; } if ($ryform_pos === 0) { $value = array_values(array_merge(array($ryform), $savedRyform)); } else { if ($ryform_pos !== NULL) { $begin = array_slice($savedRyform, 0, $ryform_pos); $end = array_slice($savedRyform, $ryform_pos, count($savedRyform) - $ryform_pos); $value = array_values(array_merge($begin, array($ryform), $end)); } else { $value[] = $ryform; } } p($ryform_name, $value); //return array(DATA_RYFORM_VALUE, array('stages' => array())); return array(DATA_RYFORM_VALUE, array($ryform_name => $value)); } else { p($ryform_name, $ryform); return array(DATA_RYFORM_VALUE, array($ryform_name => $ryform)); } break; case 'edit': $a_ryforms = $def->value; if (is_array($a_ryforms)) { $ryform = $a_ryforms[$ryform_pos]; } else { $ryform = $a_ryforms; } $ryform->postSerialization(); $validate = isset($url_params['validate']) && $url_params['validate']; $form = new ryForm('', $def->name); foreach ($ryform->getFormDefs() as $form_def) { $form->addDefine($form_def); $name = $form_def->name; // Init form with ryfom values if (property_exists($ryform, $name)) { $form->addValue($form_def->name, $ryform->{$name}); } } foreach ($ryform->getFormDefsExtraValues() as $def_name => $extra_values) { $form->addExtraValues($def_name, $extra_values); } $form->setTemplate($ryform->getTemplate()); list($result_type, $value) = $form->getForm(array('action' => $url_params['action'], 'script' => $url_params['script'], 'ryform_action' => $next_action, 'ryform_parent' => $this_ryform_name, 'ryform_name' => implode('/', $ryforms), 'validate' => $validate)); if ($result_type == DATA_HTML_FORM) { return array(DATA_HTML_FORM, $value); } else { if ($result_type == DATA_FORM_VALUES) { $value = $form->validateFormPost($value); } $ryform->setFormParams($value); $ryform->preSerialization(); } if (is_array($a_ryforms)) { $a_ryforms[$ryform_pos] = $ryform; } else { $a_ryforms = $ryform; } $value = array($ryform_name => $a_ryforms); return array(DATA_RYFORM_VALUE, $value); break; case 'del': $id = $ryform_pos; p($def->value); if (!is_array($def->value)) { $def->value = array(); } else { unset($def->value[$id]); } $value = array_values($def->value); return array(DATA_RYFORM_VALUE, array($ryform_name => $value)); break; case 'up': $a_ryforms = $def->value; if (!is_array($a_ryforms)) { ryzom_redirect(_url($url_params, array('ryform_action' => ''))); } $temp_ryform = $a_ryforms[$ryform_pos - 1]; $a_ryforms[$ryform_pos - 1] = $a_ryforms[$ryform_pos]; $a_ryforms[$ryform_pos] = $temp_ryform; $a_ryforms = array_values($a_ryforms); p($ryform_name, $a_ryforms); return array(DATA_RYFORM_VALUE, array($ryform_name => $a_ryforms)); break; case 'down': $a_ryforms = $def->value; if (!is_array($a_ryforms)) { ryzom_redirect(_url($url_params, array('ryform_action' => ''))); } $temp_ryform = $a_ryforms[$ryform_pos + 1]; $a_ryforms[$ryform_pos + 1] = $a_ryforms[$ryform_pos]; $a_ryforms[$ryform_pos] = $temp_ryform; $a_ryforms = array_values($a_ryforms); return array(DATA_RYFORM_VALUE, array($ryform_name => $a_ryforms)); break; case 'source': $a_ryforms = $def->value; if (is_array($a_ryforms)) { $ryform = $a_ryforms[$ryform_pos]; } else { $ryform = $a_ryforms; } $ryform->postSerialization(); $form = new ryForm('', $def->name); $form->addDefine(new ryFormDef('ryform_source', DEF_TYPE_TEXTAREA, '', base64_encode(serialize($ryform)))); $validate = isset($url_params['validate']) && $url_params['validate']; list($result_type, $value) = $form->getForm(array('ryform_action' => $next_action, 'ryform_parent' => $this_ryform_name, 'ryform_name' => implode('/', $ryforms), 'validate' => $validate)); if ($result_type == DATA_HTML_FORM) { return array(DATA_HTML_FORM, $value); } else { if ($result_type == DATA_FORM_VALUES) { $params = $form->validateFormPost($value); } else { $params = $value; } $ryform = unserialize(base64_decode($params['ryform_source'])); if (!is_object($ryform)) { unset($url_params['validate']); ryzom_redirect(_url($url_params, array('ryform_action' => '', 'message' => 'bad_paste'))); } $is_valid = false; p($def->params); foreach ($def->params as $id => $ryform_class) { if (is_array($ryform_class)) { if (in_array(get_class($ryform), array_values($ryform_class))) { $is_valid = true; } } else { if (get_class($ryform) == $ryform_class) { $is_valid = true; } } } if (!$is_valid) { p(get_class($ryform), $def->params); ryzom_redirect(_url($url_params, array($deffullname . '_action' => '', 'message' => 'not_valid_stage'))); return; } if (is_array($a_ryforms)) { $a_ryforms[$ryform_pos] = $ryform; } else { $a_ryforms = $ryform; } $value = array($ryform_name => $a_ryforms); return array(DATA_RYFORM_VALUE, $value); } return; break; } return $ret; }
<?php /** * Copyright: dtbaker 2012 * Licence: Please check CodeCanyon.net for licence details. * More licence clarification available here: http://codecanyon.net/wiki/support/legal-terms/licensing-terms/ * Deploy: 9809 f200f46c2a19bb98d112f2d32a8de0c4 * Envato: 4ffca17e-861e-4921-86c3-8931978c40ca * Package Date: 2015-11-25 02:55:20 * IP Address: 67.79.165.254 */ $module->page_title = _l('Statistics'); $newsletter_id = isset($_REQUEST['newsletter_id']) ? (int) $_REQUEST['newsletter_id'] : false; if (!$newsletter_id) { set_error('Sorry no newsletter id specified'); redirect_browser(module_newsletter::link_list(0)); } $newsletter = module_newsletter::get_newsletter($newsletter_id); // great a new blank send table ready to go (only if user clicks confirm) $send_id = isset($_REQUEST['send_id']) ? (int) $_REQUEST['send_id'] : false; if (!$send_id) { set_error('Sorry no newsletter send id specified'); redirect_browser(module_newsletter::link_open($newsletter_id)); } $send = module_newsletter::get_send($send_id); if ($send['status'] != _NEWSLETTER_STATUS_SENT) { // hasnt sent yet, redirect to the pending watch page. redirect_browser(module_newsletter::link_queue_watch($newsletter_id, $send_id)); } $start_time = $send['start_time']; if (isset($_REQUEST['show'])) {
<input type="hidden" name="<?php echo $use_master_key; ?> " value="<?php echo $search[$use_master_key]; ?> "> <?php } ?> <?php $search_bar = array('elements' => array('name' => array('title' => _l('Contact Name, Email or Phone Number:'), 'field' => array('type' => 'text', 'name' => 'search[generic]', 'value' => isset($search['generic']) ? $search['generic'] : '', 'size' => 30)))); echo module_form::search_bar($search_bar); /** START TABLE LAYOUT **/ $table_manager = module_theme::new_table_manager(); $columns = array(); $columns['name'] = array('title' => 'Name', 'callback' => function ($user) { echo module_user::link_open_contact($user['user_id'], true, $user); if ($user['is_primary'] == $user['user_id']) { echo ' *'; } }, 'cell_class' => 'row_action'); $columns['phone'] = array('title' => 'Phone Number', 'callback' => function ($user) { module_user::print_contact_summary($user['user_id'], 'html', array('phone|mobile')); }); $columns['email'] = array('title' => 'Email Address', 'callback' => function ($user) { module_user::print_contact_summary($user['user_id'], 'html', array('email'));
function handle_hook($hook, $calling_module = false, $owner_table = false, $key_name = false, $key_value = false, $rel_data = false) { switch ($hook) { case "home_alerts": $alerts = array(); if (module_config::c('allow_note_reminders', 1)) { // find any jobs that are past the due date and dont have a finished date. $key = _l('Note Reminder'); if (class_exists('module_dashboard', false)) { module_dashboard::register_group($key, array('columns' => array('name' => _l('Reminder'), 'type' => _l('Type'), 'full_link' => _l('Link'), 'date' => _l('Date'), 'days' => _l('Date')))); } $sql = "SELECT * FROM `" . _DB_PREFIX . "note` n "; $sql .= " WHERE n.`reminder` = 1 AND n.note_time < " . (int) strtotime('+' . module_config::c('alert_days_in_future', 5) . ' days') . ""; $sql .= " AND ( n.`user_id` = 0 OR n.`user_id` = " . module_security::get_loggedin_id() . ")"; $sql .= " ORDER BY n.note_time ASC"; $tasks = qa($sql); foreach ($tasks as $task) { $alert_res = process_alert(date('Y-m-d', $task['note_time']), $key); if ($alert_res) { $alert_res['link'] = $task['rel_data']; // fix for linking when changing folder. $alert_res['type'] = _l(ucwords($task['owner_table'])); switch ($task['owner_table']) { case 'user': $user = module_user::get_user($task['owner_id']); if ($user['customer_id'] || $user['vendor_id']) { $alert_res['link'] = module_user::link_open_contact($task['owner_id'], false, $user); $alert_res['full_link'] = module_user::link_open_contact($task['owner_id'], true, $user); $alert_res['type'] = _l('Contact'); } else { $alert_res['link'] = module_user::link_open($task['owner_id'], false, $user); $alert_res['full_link'] = module_user::link_open($task['owner_id'], true, $user); } break; case 'invoice': $invoice_data = module_invoice::get_invoice($task['owner_id'], true); if (!$invoice_data || !isset($invoice_data['invoice_id']) || $invoice_data['invoice_id'] != $task['owner_id']) { continue 2; } $alert_res['link'] = module_invoice::link_open($task['owner_id'], false, $invoice_data); $alert_res['full_link'] = module_invoice::link_open($task['owner_id'], true, $invoice_data); break; case 'quote': $quote_data = module_quote::get_quote($task['owner_id'], true); if (!$quote_data || !isset($quote_data['quote_id']) || $quote_data['quote_id'] != $task['owner_id']) { continue 2; } $alert_res['link'] = module_quote::link_open($task['owner_id'], false, $quote_data); $alert_res['full_link'] = module_quote::link_open($task['owner_id'], true, $quote_data); break; case 'website': $website_data = module_website::get_website($task['owner_id']); if (!$website_data || !isset($website_data['website_id']) || $website_data['website_id'] != $task['owner_id']) { continue 2; } $alert_res['link'] = module_website::link_open($task['owner_id'], false); $alert_res['full_link'] = module_website::link_open($task['owner_id'], true); break; case 'customer': $customer_data = module_customer::get_customer($task['owner_id']); if (!$customer_data || !isset($customer_data['customer_id']) || $customer_data['customer_id'] != $task['owner_id']) { continue 2; } $alert_res['link'] = module_customer::link_open($task['owner_id'], false, $customer_data); $alert_res['full_link'] = module_customer::link_open($task['owner_id'], true, $customer_data); break; case 'vendor': $vendor_data = module_vendor::get_vendor($task['owner_id']); if (!$vendor_data || !isset($vendor_data['vendor_id']) || $vendor_data['vendor_id'] != $task['owner_id']) { continue 2; } $alert_res['link'] = module_vendor::link_open($task['owner_id'], false, $vendor_data); $alert_res['full_link'] = module_vendor::link_open($task['owner_id'], true, $vendor_data); break; case 'job': $job_data = module_job::get_job($task['owner_id']); if (!$job_data || !isset($job_data['job_id']) || $job_data['job_id'] != $task['owner_id']) { continue 2; } $alert_res['link'] = module_job::link_open($task['owner_id'], false, $job_data); $alert_res['full_link'] = module_job::link_open($task['owner_id'], true, $job_data); break; // todo - add others. } $alert_res['name'] = $task['note']; $alert_res['date'] = print_date($alert_res['date']); $alert_res['time'] = $task['note_time']; $alerts[] = $alert_res; } } } return $alerts; break; /*case "note_list": if($owner_id && $owner_id != 'new'){ $note_items = $this->get_notes(array("owner_table"=>$owner_table,"owner_id"=>$owner_id)); foreach($note_items as &$note_item){ // do it in loop here because of $this issues in static method below. // instead of include file below. $note_item['html'] = $this->print_note($note_item['note_id']); } include("pages/note_list.php"); }else{ echo 'Please save first before creating notes.'; } break;*/ /*case "note_list": if($owner_id && $owner_id != 'new'){ $note_items = $this->get_notes(array("owner_table"=>$owner_table,"owner_id"=>$owner_id)); foreach($note_items as &$note_item){ // do it in loop here because of $this issues in static method below. // instead of include file below. $note_item['html'] = $this->print_note($note_item['note_id']); } include("pages/note_list.php"); }else{ echo 'Please save first before creating notes.'; } break;*/ case "note_delete": // find the key we are saving this address against. $owner_id = (int) $key_value; if (!$owner_id || $owner_id == 'new') { // find one in the post data. if (isset($_REQUEST[$key_name])) { $owner_id = $_REQUEST[$key_name]; } } $note_hash = md5($owner_id . '|' . $owner_table); // just for posting unique arrays. if ($owner_table && $owner_id) { $this->note_delete($owner_table, $owner_id); } break; } }
echo '<strong>{' . htmlspecialchars($key) . '}</strong>'; if ($val && !is_array($val)) { echo ' ' . htmlspecialchars($val); } echo '</li>'; } } else { } ?> </ul> <br/><br/> </td> </tr> </tbody> </table> <?php $fieldset_data = array('heading' => array('type' => 'h2', 'main' => true, 'title' => 'Edit Template'), 'elements_before' => ob_get_clean()); echo module_form::generate_fieldset($fieldset_data); unset($fieldset_data); $form_actions = array('class' => 'action_bar action_bar_center', 'elements' => array(array('type' => 'save_button', 'name' => 'butt_save', 'value' => _l('Save')), array('ignore' => !(module_template::can_i('delete', 'Templates') && (int) $template_id > 0), 'type' => 'delete_button', 'name' => 'butt_del', 'value' => _l('Delete')), array('type' => 'button', 'name' => 'cancel', 'value' => _l('Cancel'), 'class' => 'submit_button', 'onclick' => "window.location.href='" . $module->link('template', array('template_id' => false)) . "';"))); echo module_form::generate_form_actions($form_actions); ?> </form>
"oLanguage": { "sSearch": "<?php echo _l("Search", $this); ?> :", "oPaginate":{ "sNext": "<?php echo _l("Next", $this); ?> ", "sPrevious": "<?php echo _l("Previous", $this); ?> " }, "sZeroRecords": "<?php echo _l("No matching records found", $this); ?> ", "sLengthMenu": "<?php echo _l("_MENU_ Records per page", $this); ?> " } } ); } ); </script>
} else { console.log('Address ' + address + ' not found: ' + status); } }); }, 300 * timeout_index); })(); } } <?php if (empty($search['location'])) { ?> map.fitBounds(bounds); <?php } ?> } </script> <form action="" method="post"> <?php module_form::print_form_auth(); ?> <?php $search_bar = array('elements' => array('name' => array('title' => _l('Location:'), 'field' => array('type' => 'text', 'name' => 'search[location]', 'value' => isset($search['location']) ? $search['location'] : '')))); echo module_form::search_bar($search_bar); ?> </form> <div id="map-canvas"></div>
<label class="label"><?php _l('editor.link.text.label'); ?> </label> <input class="input" type="text" name="text" value="<?php __($text); ?> "> <p class="field-help marginalia"><?php _l('editor.link.text.help'); ?> </p> </div> <div class="buttons cf"> <a class="btn btn-rounded btn-cancel" href="<?php __($back); ?> "><?php _l('cancel'); ?> </a> <input class="btn btn-rounded btn-submit" type="submit" value="<?php _l('insert'); ?> "> </div> </fieldset> </form> </div>
include('quote_public.php'); $quote['quote_tasks'] = ob_get_clean();*/ // generate the PDF ready for sending. $pdf = module_quote::generate_pdf($quote_id); // find available "to" recipients. // customer contacts. $to_select = false; if ($quote['customer_id']) { $customer = module_customer::get_customer($quote['customer_id']); $quote['customer_name'] = $customer['customer_name']; $to = module_user::get_contacts(array('customer_id' => $quote['customer_id'])); if ($quote['contact_user_id']) { $primary = module_user::get_user($quote['contact_user_id']); if ($primary) { $to_select = $primary['email']; } } else { if ($customer['primary_user_id']) { $primary = module_user::get_user($customer['primary_user_id']); if ($primary) { $to_select = $primary['email']; } } } } else { $to = array(); } $template->assign_values($quote); ob_start(); module_email::print_compose(array('title' => _l('Email Quote: %s', $quote['name']), 'find_other_templates' => 'quote_email', 'current_template' => $template_name, 'customer_id' => $quote['customer_id'], 'quote_id' => $quote['quote_id'], 'debug_message' => 'Sending quote as email', 'to' => $to, 'to_select' => $to_select, 'bcc' => module_config::c('admin_email_address', ''), 'content' => $template->render('html'), 'subject' => $template->replace_description(), 'success_url' => module_quote::link_open($quote_id), 'cancel_url' => module_quote::link_open($quote_id), 'attachments' => array(array('path' => $pdf, 'name' => basename($pdf), 'preview' => module_quote::link_public_print($quote_id)))));
public function process() { $errors = array(); if (isset($_REQUEST['butt_del']) && $_REQUEST['butt_del'] && $_REQUEST['report_id']) { $data = self::get_report($_REQUEST['report_id']); if (module_form::confirm_delete('report_id', "Really delete " . _l('Report') . ": " . $data['name'], self::link_open($_REQUEST['report_id']))) { $this->delete_report($_REQUEST['report_id']); set_message(_l('Report') . " deleted successfully"); redirect_browser(self::link_open(false)); } } else { if ("save_report" == $_REQUEST['_process']) { $report_id = $this->save_report($_REQUEST['report_id'], $_POST); $_REQUEST['_redirect'] = $this->link_open($report_id); set_message(_l('Report') . " saved successfully"); } } if (!count($errors)) { redirect_browser($_REQUEST['_redirect']); exit; } print_error($errors, true); }
<script type="text/javascript" src="<?php echo base_url(); ?> assets/flatlab/js/jquery.validate.min.js"></script> <script> $("#post_form").validate({ rules: { "data[email]": { required: true, }, "data[password]": { required: true } }, messages: { "data[email]":{ required: "<?php echo _l("Please enter a username or email address.", $this); ?> ", }, "data[password]":{ required: "<?php echo _l("Please enter your password.", $this); ?> " } } }); </script>
?> " class="fa fa-pencil"></i></a> <a href="<?php echo $base_url; ?> delete<?php echo $page; ?> /<?php echo $data["currency_id"]; ?> " class="btn btn-danger btn-sm" title="<?php echo _l('Delete', $this); ?> "><i title="<?php echo _l('Delete', $this); ?> " class="fa fa-trash-o"></i></a> </td> </tr> <?php } ?> </tbody> </table> </div> <?php } ?> </div> </section>
public function buildForm(array $form, FormStateInterface $form_state) { $form = parent::buildForm($form, $form_state); $config = $this->config('swiftmailer.message'); $form['#tree'] = TRUE; $form['description'] = array('#markup' => '<p>' . t('This page allows you to configure settings which determines how e-mail messages are created.') . '</p>'); if (swiftmailer_validate_library($config->get('path', SWIFTMAILER_VARIABLE_PATH_DEFAULT))) { $form['format'] = array('#type' => 'fieldset', '#title' => t('Message format'), '#description' => t('You can set the default message format which should be applied to e-mail messages.')); $form['format']['type'] = array('#type' => 'radios', '#options' => array(SWIFTMAILER_FORMAT_PLAIN => t('Plain Text'), SWIFTMAILER_FORMAT_HTML => t('HTML')), '#default_value' => $config->get('format', SWIFTMAILER_VARIABLE_FORMAT_DEFAULT)); $form['format']['respect'] = array('#type' => 'checkbox', '#title' => t('Respect provided e-mail format.'), '#default_value' => $config->get('respect_format', SWIFTMAILER_VARIABLE_RESPECT_FORMAT_DEFAULT), '#description' => t('The header "Content-Type", if available, will be respected if you enable this setting. Settings such as e-mail format ("text/plain" or "text/html") and character set may be provided through this header. Unless your site somehow alters e-mails, enabling this setting will result in all e-mails to be sent as plain text as this is the content type Drupal by default will apply to all e-mails.')); $form['convert'] = array('#type' => 'fieldset', '#title' => t('Plain Text Version'), '#description' => t('An alternative plain text version can be generated based on the HTML version if no plain text version has been explicitly set. The plain text version will be used by e-mail clients not capable of displaying HTML content.'), '#states' => array('visible' => array('input[type=radio][name=format[type]]' => array('value' => SWIFTMAILER_FORMAT_HTML)))); $form['convert']['mode'] = array('#type' => 'checkbox', '#title' => t('Generate alternative plain text version.'), '#default_value' => $config->get('convert_mode', SWIFTMAILER_VARIABLE_CONVERT_MODE_DEFAULT), '#description' => t('Please refer to !link for more details about how the alternative plain text version will be generated.', array('!link' => \Drupal::l('html2text', Url::fromUri('http://www.chuggnutt.com/html2text'))))); $form['character_set'] = array('#type' => 'fieldset', '#title' => t('Character Set'), '#description' => '<p>' . t('E-mails need to carry details about the character set which the receiving client should use to understand the content of the e-mail. The default character set is UTF-8.') . '</p>'); $form['character_set']['type'] = array('#type' => 'select', '#options' => swiftmailer_get_character_set_options(), '#default_value' => $config->get('character_set', SWIFTMAILER_VARIABLE_CHARACTER_SET_DEFAULT)); } else { $form['message'] = array('#markup' => '<p>' . t('You need to configure the location of the Swift Mailer library. Please visit the !page and configure the library to enable the configuration options on this page.', array('!page' => _l(t('library configuration page'), 'admin/config/people/swiftmailer'))) . '</p>'); } return $form; }