Exemplo n.º 1
0
 /**
  * Standard modular run function.
  *
  * @return tempcode	The result of execution.
  */
 function run()
 {
     require_lang('bulkupload');
     $GLOBALS['HELPER_PANEL_PIC'] = 'pagepics/bulkuploadassistant';
     $GLOBALS['HELPER_PANEL_TUTORIAL'] = 'tut_adv_comcode';
     $GLOBALS['HELPER_PANEL_TEXT'] = comcode_lang_string('DOC_BULK_UPLOAD');
     $title = get_page_title('BULK_UPLOAD');
     $parameter = post_param('parameter', '');
     require_code('form_templates');
     if ($parameter == '') {
         $post_url = build_url(array('page' => '_SELF'), '_SELF');
         $text = paragraph(do_lang_tempcode('BULK_UPLOAD_HELP'));
         $submit_name = do_lang_tempcode('BULK_UPLOAD');
         $fields = form_input_line(do_lang_tempcode('DIRECTORY'), do_lang_tempcode('DIRECTORY_BULK'), 'parameter', 'uploads/attachments/' . date('Y-m-d', utctime_to_usertime()), true);
         return do_template('FORM_SCREEN', array('_GUID' => '77a2ca460745145d8a1d18cf24971fea', 'SKIP_VALIDATION' => true, 'HIDDEN' => '', 'FIELDS' => $fields, 'URL' => $post_url, 'TITLE' => $title, 'TEXT' => $text, 'SUBMIT_NAME' => $submit_name));
     } else {
         breadcrumb_set_parents(array(array('_SELF:_SELF:misc', do_lang_tempcode('BULK_UPLOAD'))));
         breadcrumb_set_self(do_lang_tempcode('_RESULTS'));
         $out = $this->do_dir(get_custom_file_base() . '/' . filter_naughty($parameter, true));
         if ($out->is_empty()) {
             inform_exit(do_lang_tempcode('NO_FILES'));
         }
         return do_template('BULK_HELPER_RESULTS_SCREEN', array('_GUID' => '5d373553cf21a58f15006bd4e600a9ee', 'TITLE' => $title, 'RESULTS' => $out));
     }
 }
Exemplo n.º 2
0
/**
 * Get a do-next manager for bookings.
 *
 * @return tempcode	Booking do-next manager.
 */
function booking_do_next()
{
    require_lang('calendar');
    require_code('templates_donext');
    require_code('fields');
    return do_next_manager(get_page_title('BOOKINGS'), comcode_lang_string('DOC_BOOKING'), array(has_specific_permission(get_member(), 'submit_cat_highrange_content', 'cms_booking') ? array('bookable', array('_SELF', array('type' => 'ad'), '_SELF'), do_lang('ADD_BOOKABLE')) : NULL, has_specific_permission(get_member(), 'edit_cat_highrange_content', 'cms_booking') ? array('bookable', array('_SELF', array('type' => 'ed'), '_SELF'), do_lang('EDIT_BOOKABLE')) : NULL, has_specific_permission(get_member(), 'submit_cat_highrange_content', 'cms_booking') ? array('supplement', array('_SELF', array('type' => 'av'), '_SELF'), do_lang('ADD_BOOKABLE_SUPPLEMENT')) : NULL, has_specific_permission(get_member(), 'edit_cat_highrange_content', 'cms_booking') ? array('supplement', array('_SELF', array('type' => 'ev'), '_SELF'), do_lang('EDIT_BOOKABLE_SUPPLEMENT')) : NULL, has_specific_permission(get_member(), 'submit_cat_highrange_content', 'cms_booking') ? array('blacked', array('_SELF', array('type' => 'ac'), '_SELF'), do_lang('ADD_BOOKABLE_BLACKED')) : NULL, has_specific_permission(get_member(), 'edit_cat_highrange_content', 'cms_booking') ? array('blacked', array('_SELF', array('type' => 'ec'), '_SELF'), do_lang('EDIT_BOOKABLE_BLACKED')) : NULL, has_specific_permission(get_member(), 'submit_highrange_content', 'cms_booking') ? array('booking', array('_SELF', array('type' => 'ab'), '_SELF'), do_lang('ADD_BOOKING')) : NULL, has_specific_permission(get_member(), 'edit_highrange_content', 'cms_booking') ? array('booking', array('_SELF', array('type' => 'eb'), '_SELF'), do_lang('EDIT_BOOKING')) : NULL, has_actual_page_access(get_member(), 'calendar') ? array('calendar', array('calendar', array('type' => 'misc', 'view' => 'month'), '_SEARCH'), do_lang('CALENDAR')) : NULL), do_lang('BOOKINGS'));
}
Exemplo n.º 3
0
 /**
  * Standard modular run function.
  *
  * @return tempcode	The result of execution.
  */
 function run()
 {
     require_lang('themes');
     require_code('themes2');
     require_code('themewizard');
     $GLOBALS['HELPER_PANEL_PIC'] = 'pagepics/themewizard';
     $GLOBALS['HELPER_PANEL_TUTORIAL'] = 'tut_themes';
     $GLOBALS['HELPER_PANEL_TEXT'] = comcode_lang_string('DOC_THEMEWIZARD');
     $type = get_param('type', 'misc');
     if ($type == 'misc') {
         return $this->step1();
     }
     if ($type == 'step2') {
         return $this->step2();
     }
     if ($type == 'step3') {
         return $this->step3();
     }
     if ($type == 'step4') {
         return $this->step4();
     }
     if ($type == 'make_logo') {
         return $this->make_logo();
     }
     if ($type == '_make_logo') {
         return $this->_make_logo();
     }
     if ($type == '__make_logo') {
         return $this->__make_logo();
     }
     return new ocp_tempcode();
 }
Exemplo n.º 4
0
 /**
  * The do-next manager for before content management.
  *
  * @return tempcode		The UI
  */
 function misc()
 {
     require_lang('menus');
     $also_url = build_url(array('page' => 'cms_chat'), get_module_zone('cms_chat'));
     attach_message(do_lang_tempcode('ALSO_SEE_CMS', escape_html($also_url->evaluate())), 'inform');
     $this->add_one_label = do_lang_tempcode('ADD_CHATROOM');
     $this->edit_this_label = do_lang_tempcode('EDIT_THIS_CHATROOM');
     $this->edit_one_label = do_lang_tempcode('EDIT_CHATROOM');
     require_code('templates_donext');
     return do_next_manager(get_page_title('MANAGE_CHATROOMS'), comcode_lang_string('DOC_CHAT'), array(array('add_one', array('_SELF', array('type' => 'ad'), '_SELF'), do_lang('ADD_CHATROOM')), array('edit_one', array('_SELF', array('type' => 'ed'), '_SELF'), do_lang('EDIT_CHATROOM')), array('delete', array('_SELF', array('type' => 'delete_all'), '_SELF'), do_lang('DELETE_ALL_ROOMS'))), do_lang('MANAGE_CHATROOMS'));
 }
Exemplo n.º 5
0
 /**
  * Standard modular run function.
  *
  * @return tempcode	The result of execution.
  */
 function run()
 {
     $GLOBALS['HELPER_PANEL_PIC'] = 'pagepics/trackbacks';
     $GLOBALS['HELPER_PANEL_TEXT'] = comcode_lang_string('DOC_TRACKBACKS');
     require_lang('trackbacks');
     $type = get_param('type', 'misc');
     if ($type == 'misc') {
         return $this->choose();
     }
     if ($type == 'delete') {
         return $this->delete_trackbacks();
     }
     return new ocp_tempcode();
 }
Exemplo n.º 6
0
 /**
  * Standard modular run function.
  *
  * @return tempcode	The result of execution.
  */
 function run()
 {
     require_lang('debrand');
     require_lang('config');
     $GLOBALS['HELPER_PANEL_PIC'] = 'pagepics/debrand';
     $GLOBALS['HELPER_PANEL_TEXT'] = comcode_lang_string('DOC_SUPERDEBRAND');
     $type = get_param('type', 'misc');
     if ($type == 'misc') {
         return $this->misc();
     }
     if ($type == 'actual') {
         return $this->actual();
     }
     return new ocp_tempcode();
 }
Exemplo n.º 7
0
 /**
  * Standard modular run function.
  *
  * @return tempcode	The result of execution.
  */
 function run()
 {
     $type = get_param('type', 'misc');
     require_code('xml_storage');
     require_lang('xml_storage');
     $GLOBALS['HELPER_PANEL_PIC'] = 'pagepics/xml';
     $GLOBALS['HELPER_PANEL_TEXT'] = comcode_lang_string('DOC_XML_DATA_MANAGEMENT');
     switch ($type) {
         case 'misc':
             return $this->ui();
         case '_import':
             return $this->_import();
         case '_export':
             return $this->_export();
     }
     return new ocp_tempcode();
 }
Exemplo n.º 8
0
 /**
  * Standard modular run function.
  *
  * @return tempcode	The result of execution.
  */
 function run()
 {
     if (get_file_base() != get_custom_file_base()) {
         warn_exit(do_lang_tempcode('SHARED_INSTALL_PROHIBIT'));
     }
     require_lang('menus');
     get_page_title('PHP_INFO');
     $GLOBALS['SCREEN_TEMPLATE_CALLED'] = '';
     $GLOBALS['TITLE_CALLED'] = true;
     require_lang('menus');
     $GLOBALS['HELPER_PANEL_TEXT'] = comcode_lang_string('DOC_PHP_INFO');
     ob_start();
     phpinfo();
     require_code('xhtml');
     $out = xhtmlise_html(ob_get_contents());
     ob_end_clean();
     $out = preg_replace('#<!DOCTYPE[^>]*>#s', '', preg_replace('#</body[^>]*>#', '', preg_replace('#<body[^>]*>#', '', preg_replace('#</html[^>]*>#', '', preg_replace('#<html[^>]*>#', '', $out)))));
     $matches = array();
     if (preg_match('#<style[^>]*>#', $out, $matches) != 0) {
         $offset = strpos($out, $matches[0]) + strlen($matches[0]);
         $end = strpos($out, '</style>', $offset);
         if ($end !== false) {
             $style = substr($out, $offset - strlen($matches[0]), $end - $offset + strlen('</style>') + strlen($matches[0]));
             //$GLOBALS['EXTRA_HEAD']=make_string_tempcode($style);
             $out = substr($out, 0, $offset) . substr($out, $end);
         }
     }
     $out = preg_replace('#<head[^>]*>.*</head[^>]*>#s', '', $out);
     $out = str_replace(' width="600"', ' width="100%"', $out);
     $out = preg_replace('#([^\\s<>"\']{65}&[^;]+;)#', '${1}<br />', $out);
     $out = preg_replace('#([^\\s<>"\']{95})#', '${1}<br />', $out);
     $url_parts = parse_url(get_base_url());
     $out = str_replace('<img border="0" src="/', '<img border="0" style="padding-top: 20px" src="http://' . escape_html($url_parts['host']) . '/', $out);
     require_css('phpinfo');
     require_code('xhtml');
     $ret = make_string_tempcode(xhtmlise_html($out));
     return $ret;
 }
Exemplo n.º 9
0
 /**
  * The UI to translate code.
  *
  * @return tempcode		The UI
  */
 function interface_code()
 {
     $lang = filter_naughty_harsh(get_param('lang', ''));
     $lang_new = get_param('lang_new', $lang);
     if ($lang_new != '') {
         require_code('type_validation');
         if (!is_alphanumeric($lang_new, true)) {
             warn_exit(do_lang_tempcode('BAD_CODENAME'));
         }
         if (strlen($lang_new) > 5) {
             warn_exit(do_lang_tempcode('INVALID_LANG_CODE'));
         }
         $lang = $lang_new;
     }
     if ($lang == '') {
         $title = get_page_title('TRANSLATE_CODE');
         $GLOBALS['HELPER_PANEL_TEXT'] = comcode_lang_string('DOC_FIND_LANG_STRING_TIP');
         return $this->choose_lang($title, true, true, do_lang_tempcode('CHOOSE_EDIT_LIST_LANG_FILE'));
     }
     breadcrumb_set_parents(array(array('_SELF:_SELF:misc', do_lang_tempcode('CHOOSE'))));
     breadcrumb_set_self(do_lang_tempcode('TRANSLATE_CODE'));
     $base_lang = fallback_lang();
     $map_a = get_file_base() . '/lang/langs.ini';
     $map_b = get_custom_file_base() . '/lang_custom/langs.ini';
     $search = get_param('search', '', true);
     if ($search != '') {
         $title = get_page_title('TRANSLATE_CODE');
         require_code('form_templates');
         $fields = new ocp_tempcode();
         global $LANGUAGE;
         foreach ($LANGUAGE[user_lang()] as $key => $value) {
             if (strpos(strtolower($value), strtolower($search)) !== false) {
                 $fields->attach(form_input_text($key, '', 'l_' . $key, str_replace('\\n', chr(10), $value), false));
             }
         }
         if ($fields->is_empty()) {
             inform_exit(do_lang_tempcode('NO_ENTRIES'));
         }
         $post_url = build_url(array('page' => '_SELF', 'type' => '_code2'), '_SELF');
         $hidden = new ocp_tempcode();
         $hidden->attach(form_input_hidden('redirect', get_self_url(true)));
         $hidden->attach(form_input_hidden('lang', $lang));
         return do_template('FORM_SCREEN', array('_GUID' => '2d7356fd2c4497ceb19450e65331c9c5', 'TITLE' => $title, 'HIDDEN' => $hidden, 'FIELDS' => $fields, 'URL' => $post_url, 'TEXT' => '', 'SUBMIT_NAME' => do_lang('TRANSLATE_CODE')));
     }
     $lang_file = get_param('lang_file');
     if (!file_exists($map_b)) {
         $map_b = $map_a;
     }
     $map = better_parse_ini_file($map_b);
     $title = get_page_title('_TRANSLATE_CODE', true, array(escape_html($lang_file), escape_html(array_key_exists($lang, $map) ? $map[$lang] : $lang)));
     // Upgrade to custom if not there yet (or maybe we are creating a new lang - same difference)
     $custom_dir = get_custom_file_base() . '/lang_custom/' . $lang;
     if (!file_exists($custom_dir)) {
         require_code('abstract_file_manager');
         force_have_afm_details();
         afm_make_directory('lang_custom/' . $lang, true);
         $cached_dir = get_custom_file_base() . '/lang_cached/' . $lang;
         if (!file_exists($cached_dir)) {
             afm_make_directory('lang_cached/' . $lang, true);
         }
         // Make comcode page dirs
         $zones = find_all_zones();
         foreach ($zones as $zone) {
             $_special_dir = get_custom_file_base() . '/' . $zone . '/pages/comcode_custom/' . $lang;
             if (!file_exists($_special_dir)) {
                 afm_make_directory($zone . ($zone == '' ? '' : '/') . 'pages/comcode_custom/' . $lang, true);
             }
             $_special_dir = get_custom_file_base() . '/' . $zone . '/pages/html_custom/' . $lang;
             if (!file_exists($_special_dir)) {
                 afm_make_directory($zone . ($zone == '' ? '' : '/') . 'pages/html_custom/' . $lang, true);
             }
         }
         // Make templates_cached dirs
         require_code('themes2');
         $themes = find_all_themes();
         foreach (array_keys($themes) as $theme) {
             $_special_dir = get_custom_file_base() . '/themes/' . $theme . '/templates_cached/' . $lang;
             if (!file_exists($_special_dir)) {
                 afm_make_directory('themes/' . $theme . '/templates_cached/' . $lang, true);
             }
         }
     }
     // Get some stuff
     $for_lang = get_lang_file_map($lang, $lang_file);
     $for_base_lang = get_lang_file_map($base_lang, $lang_file, true);
     $descriptions = get_lang_file_descriptions($base_lang, $lang_file);
     // Make our translation page
     $lines = '';
     $intertrans = $this->get_intertran_conv($lang);
     $actions = new ocp_tempcode();
     $next = 0;
     $trans_lot = '';
     $delimit = chr(10) . '=-=-=-=-=-=-=-=-' . chr(10);
     foreach ($for_base_lang as $name => $old) {
         if (array_key_exists($name, $for_lang)) {
             $current = $for_lang[$name];
         } else {
             $current = '';
             //$this->find_lang_matches($old,$lang); Too slow / useless for code translation
         }
         if ($current == '' && strtolower($name) != $name) {
             $trans_lot .= str_replace('\\n', chr(10), str_replace(array('{', '}'), array('(((', ')))'), $old)) . $delimit;
         }
     }
     $translated_stuff = array();
     if ($trans_lot != '' && $intertrans != '') {
         $result = http_download_file('http://translate.google.com/translate_t', NULL, false, false, 'ocPortal', array('text' => $trans_lot, 'langpair' => 'en|' . $intertrans));
         if (!is_null($result)) {
             require_code('character_sets');
             $result = convert_to_internal_encoding($result);
             $matches = array();
             if (preg_match('#<div id=result_box dir="ltr">(.*)</div>#Us', convert_to_internal_encoding($result), $matches) != 0) {
                 $result2 = $matches[1];
                 $result2 = @html_entity_decode($result2, ENT_QUOTES, get_charset());
                 $result2 = preg_replace('#\\s?<br>\\s?#', chr(10), $result2);
                 $result2 = str_replace('> ', '>', str_replace(' <', ' <', str_replace('</ ', '</', str_replace(array('(((', ')))'), array('{', '}'), $result2))));
                 $translated_stuff = explode(trim($delimit), $result2 . chr(10));
             }
         }
     }
     foreach ($for_base_lang + $for_lang as $name => $old) {
         if (array_key_exists($name, $for_lang)) {
             $current = $for_lang[$name];
         } else {
             $current = '';
             //$this->find_lang_matches($old,$lang); Too slow / useless for code translation
         }
         $description = array_key_exists($name, $descriptions) ? $descriptions[$name] : '';
         if ($current == '' && strtolower($name) != $name && array_key_exists($next, $translated_stuff)) {
             $_current = '';
             $translate_auto = trim($translated_stuff[$next]);
             $next++;
         } else {
             $_current = str_replace('\\n', chr(10), $current);
             $translate_auto = NULL;
         }
         if ($_current == '') {
             $_current = str_replace('\\n', chr(10), $old);
         }
         if ($intertrans != '' && get_value('google_translate_api_key') !== NULL) {
             $actions = do_template('TRANSLATE_ACTION', array('_GUID' => '9e9a68cb2c1a1e23a901b84c9af2280b', 'LANG_FROM' => get_site_default_lang(), 'LANG_TO' => $lang, 'NAME' => 'trans_' . $name, 'OLD' => $_current));
         }
         $temp = do_template('TRANSLATE_LINE', array('_GUID' => '9cb331f5852ee043e6ad30b45aedc43b', 'TRANSLATE_AUTO' => $translate_auto, 'DESCRIPTION' => $description, 'NAME' => $name, 'OLD' => str_replace('\\n', chr(10), $old), 'CURRENT' => $_current, 'ACTIONS' => $actions));
         $lines .= $temp->evaluate();
     }
     $url = build_url(array('page' => '_SELF', 'type' => '_code', 'lang_file' => $lang_file, 'lang' => $lang), '_SELF');
     return do_template('TRANSLATE_SCREEN', array('_GUID' => 'b3429f8bd0b4eb79c33709ca43e3207c', 'PAGE' => $lang_file, 'INTERTRANS' => get_value('google_translate_api_key') !== NULL ? $intertrans : '', 'LANG' => $lang, 'LINES' => $lines, 'TITLE' => $title, 'URL' => $url));
 }
Exemplo n.º 10
0
 /**
  * The do-next manager for before content management.
  *
  * @return tempcode		The UI
  */
 function misc()
 {
     require_code('templates_donext');
     require_lang('ocdeadpeople');
     return do_next_manager(get_page_title('OCDEADPEOPLE_TITLE'), comcode_lang_string('DOC_OCDEADPEOPLE'), array(array('add_one', array('_SELF', array('type' => 'ad'), '_SELF'), do_lang('ADD_DISEASE')), array('edit_one', array('_SELF', array('type' => 'ed'), '_SELF'), do_lang('EDIT_DISEASE'))), do_lang('OCDEADPEOPLE_TITLE'));
 }
Exemplo n.º 11
0
 /**
  * The do-next manager for before content management.
  *
  * @return tempcode		The UI
  */
 function misc()
 {
     require_code('templates_donext');
     return do_next_manager(get_page_title('MANAGE_NEWSLETTER'), comcode_lang_string('DOC_NEWSLETTER'), array_merge(array(array('add_one', array('_SELF', array('type' => 'ad'), '_SELF'), do_lang('ADD_NEWSLETTER')), array('edit_one', array('_SELF', array('type' => 'ed'), '_SELF'), do_lang('EDIT_NEWSLETTER'))), $this->extra_donext_entries), do_lang('MANAGE_NEWSLETTER'));
 }
Exemplo n.º 12
0
 /**
  * The do-next manager for before content management.
  *
  * @return tempcode		The UI
  */
 function misc()
 {
     require_code('templates_donext');
     return do_next_manager(get_page_title('MANAGE_AWARDS'), comcode_lang_string('DOC_AWARDS'), array(array('add_one', array('_SELF', array('type' => 'ad'), '_SELF'), do_lang('ADD_AWARD_TYPE')), array('edit_one', array('_SELF', array('type' => 'ed'), '_SELF'), do_lang('EDIT_AWARD_TYPE'))), do_lang('MANAGE_AWARDS'));
 }
Exemplo n.º 13
0
 /**
  * The UI to edit the breadcrumbs XML file.
  *
  * @return tempcode		The UI
  */
 function xml_breadcrumbs()
 {
     $GLOBALS['HELPER_PANEL_TUTORIAL'] = 'tut_structure';
     $GLOBALS['HELPER_PANEL_TEXT'] = comcode_lang_string('DOC_BREADCRUMB_OVERRIDES');
     $title = get_page_title('BREADCRUMB_OVERRIDES');
     $post_url = build_url(array('page' => '_SELF', 'type' => '_xml_breadcrumbs'), '_SELF');
     return do_template('XML_CONFIG_SCREEN', array('TITLE' => $title, 'POST_URL' => $post_url, 'XML' => file_exists(get_custom_file_base() . '/data_custom/breadcrumbs.xml') ? file_get_contents(get_custom_file_base() . '/data_custom/breadcrumbs.xml') : ''));
 }
Exemplo n.º 14
0
 /**
  * The do-next manager for before invoice management.
  *
  * @return tempcode		The UI
  */
 function misc()
 {
     breadcrumb_set_self(do_lang_tempcode('INVOICES'));
     breadcrumb_set_parents(array(array('_SEARCH:admin_ecommerce:ecom_usage', do_lang_tempcode('ECOMMERCE'))));
     require_code('templates_donext');
     return do_next_manager(get_page_title('INVOICES'), comcode_lang_string('DOC_ECOMMERCE'), array(array('add_one', array('_SELF', array('type' => 'ad'), '_SELF'), do_lang('CREATE_INVOICE')), array('securitylog', array('_SELF', array('type' => 'outstanding'), '_SELF'), do_lang('OUTSTANDING_INVOICES')), array('edit_one', array('_SELF', array('type' => 'undelivered'), '_SELF'), do_lang('UNDELIVERED_INVOICES'))), do_lang('INVOICES'));
 }
Exemplo n.º 15
0
 /**
  * The do-next manager for before content management. This is intended for exceptional users who cannot use the site-tree editor
  *
  * @return tempcode		The UI
  */
 function misc()
 {
     $GLOBALS['HELPER_PANEL_PIC'] = 'pagepics/sitetreeeditor';
     $GLOBALS['HELPER_PANEL_TUTORIAL'] = 'tut_structure';
     require_code('templates_donext');
     return do_next_manager(get_page_title('PAGES'), comcode_lang_string('DOC_PAGES'), array(array('comcode_page_edit', array('_SELF', array('type' => 'ed'), '_SELF'), do_lang('COMCODE_PAGE_EDIT')), array('delete', array('_SELF', array('type' => 'delete'), '_SELF'), do_lang('DELETE_PAGES')), array('move', array('_SELF', array('type' => 'move'), '_SELF'), do_lang('MOVE_PAGES'))), do_lang('PAGES'));
 }
Exemplo n.º 16
0
 /**
  * The do-next manager for before content management.
  *
  * @return tempcode		The UI
  */
 function misc()
 {
     require_code('fields');
     require_code('templates_donext');
     return do_next_manager(get_page_title('AUTHOR_MANAGE'), comcode_lang_string('DOC_AUTHORS'), array_merge(array(has_specific_permission(get_member(), 'set_own_author_profile') ? array('set-own-profile', array('_SELF', array('type' => '_ad'), '_SELF'), do_lang('EDIT_MY_AUTHOR_PROFILE')) : NULL, has_specific_permission(get_member(), 'edit_midrange_content', 'cms_authors') ? array('add_one', array('_SELF', array('type' => '_ad', 'author' => ''), '_SELF'), do_lang('ADD_AUTHOR')) : NULL, has_specific_permission(get_member(), 'edit_midrange_content', 'cms_authors') ? array('edit_one', array('_SELF', array('type' => 'ed'), '_SELF'), do_lang('EDIT_MERGE_AUTHORS')) : NULL), manage_custom_fields_donext_link('author')), do_lang('AUTHOR_MANAGE'));
 }
Exemplo n.º 17
0
 /**
  * The do-next manager for before content management.
  *
  * @return tempcode		The UI
  */
 function misc()
 {
     require_code('templates_donext');
     return do_next_manager(get_page_title('MANAGE_IOTDS'), comcode_lang_string('DOC_IOTDS'), array(has_specific_permission(get_member(), 'submit_midrange_content', 'cms_iotds') ? array('add_one', array('_SELF', array('type' => 'ad'), '_SELF'), do_lang('ADD_IOTD')) : NULL, has_specific_permission(get_member(), 'edit_own_midrange_content', 'cms_iotds') ? array('edit_one', array('_SELF', array('type' => 'ed'), '_SELF'), do_lang('EDIT_OR_CHOOSE_IOTD')) : NULL), do_lang('MANAGE_IOTDS'));
 }
Exemplo n.º 18
0
 /**
  * The do-next manager for before content management.
  *
  * @return tempcode		The UI
  */
 function misc()
 {
     require_code('templates_donext');
     require_lang('ocgifts');
     return do_next_manager(get_page_title('OCGIFTS_TITLE'), comcode_lang_string('DOC_OCGIFTS'), array(array('add_one', array('_SELF', array('type' => 'ad'), '_SELF'), do_lang('ADD_GIFT')), array('edit_one', array('_SELF', array('type' => 'ed'), '_SELF'), do_lang('EDIT_GIFT'))), do_lang('OCGIFTS_TITLE'));
 }
Exemplo n.º 19
0
 /**
  * The do-next manager for before content management.
  *
  * @return tempcode		The UI
  */
 function misc()
 {
     require_code('templates_donext');
     return do_next_manager(get_page_title('EMOTICONS'), comcode_lang_string('DOC_EMOTICONS'), array(array('emoticons', array('_SELF', array('type' => 'import'), '_SELF'), do_lang('IMPORT_EMOTICONS')), array('add_one', array('_SELF', array('type' => 'ad'), '_SELF'), do_lang('ADD_EMOTICON')), array('edit_one', array('_SELF', array('type' => 'ed'), '_SELF'), do_lang('EDIT_EMOTICON'))), do_lang('EMOTICONS'));
 }
Exemplo n.º 20
0
 /**
  * The do-next manager for before content management.
  *
  * @return tempcode		The UI
  */
 function misc()
 {
     $GLOBALS['HELPER_PANEL_PIC'] = 'pagepics/statistics';
     $GLOBALS['HELPER_PANEL_TUTORIAL'] = 'tut_statistics';
     require_code('templates_donext');
     $test = $GLOBALS['SITE_DB']->query_value('ip_country', 'COUNT(*)');
     $actions = array(array('statistics', array('_SELF', array('type' => 'overview'), '_SELF'), do_lang('OVERVIEW_STATISTICS'), 'DESCRIPTION_OVERVIEW_STATISTICS'), array('page_views', array('_SELF', array('type' => 'page'), '_SELF'), do_lang('PAGES_STATISTICS'), 'DOC_PAGE_STATISTICS'), array('users_online', array('_SELF', array('type' => 'users_online'), '_SELF'), do_lang('USERS_ONLINE_STATISTICS'), 'DOC_USERS_ONLINE_STATISTICS'), array('submits', array('_SELF', array('type' => 'submission_rates'), '_SELF'), do_lang('SUBMISSION_STATISTICS'), 'DOC_SUBMISSION_STATISTICS'), array('load_times', array('_SELF', array('type' => 'load_times'), '_SELF'), do_lang('LOAD_TIMES'), 'DOC_LOAD_TIMES'), array('top_referrers', array('_SELF', array('type' => 'referrers'), '_SELF'), do_lang('TOP_REFERRERS'), 'DOC_TOP_REFERRERS'), array('top_keywords', array('_SELF', array('type' => 'keywords'), '_SELF'), do_lang('TOP_SEARCH_KEYWORDS'), 'DOC_TOP_SEARCH_KEYWORDS'));
     $hooks = find_all_hooks('modules', 'admin_stats');
     foreach (array_keys($hooks) as $hook) {
         require_code('hooks/modules/admin_stats/' . filter_naughty_harsh($hook));
         $ob = object_factory('Hook_admin_stats_' . filter_naughty_harsh($hook), true);
         if (is_null($ob)) {
             continue;
         }
         $info = $ob->info();
         if (!is_null($info)) {
             $actions = array_merge($actions, array($info[1]));
         }
     }
     if ($test == 0) {
         $actions[] = array('geolocate', array('_SELF', array('type' => 'install_data'), '_SELF'), do_lang('INSTALL_GEOLOCATION_DATA'), 'DOC_INSTALL_GEOLOCATION_DATA');
     }
     $actions[] = array('clear_stats', array('_SELF', array('type' => 'clear'), '_SELF'), do_lang('CLEAR_STATISTICS'), do_lang_tempcode('DESCRIPTION_CLEAR_STATISTICS'));
     return do_next_manager(get_page_title('SITE_STATISTICS'), comcode_lang_string('DOC_STATISTICS'), $actions, do_lang('SITE_STATISTICS'));
 }
Exemplo n.º 21
0
 /**
  * Standard modular run function.
  *
  * @return tempcode	The result of execution.
  */
 function run()
 {
     require_code('occle');
     require_lang('occle');
     require_javascript('javascript_ajax');
     require_javascript('javascript_more');
     require_javascript('javascript_occle');
     require_css('occle');
     $GLOBALS['HELPER_PANEL_PIC'] = 'pagepics/occle';
     $GLOBALS['HELPER_PANEL_TUTORIAL'] = 'tut_occle';
     $GLOBALS['HELPER_PANEL_TEXT'] = comcode_lang_string('DOC_OCCLE');
     return $this->main_gui();
 }
Exemplo n.º 22
0
 /**
  * The do-next manager for before content management.
  *
  * @return tempcode		The UI
  */
 function misc()
 {
     if (!cron_installed()) {
         attach_message(do_lang_tempcode('CRON_NEEDED_TO_WORK', escape_html(brand_base_url() . '/docs' . strval(ocp_version()) . '/pg/tut_configuration')), 'warn');
     }
     require_code('templates_donext');
     return do_next_manager(get_page_title('WELCOME_EMAILS'), comcode_lang_string('DOC_WELCOME_EMAILS'), array(array('add_one', array('_SELF', array('type' => 'ad'), '_SELF'), do_lang('ADD_WELCOME_EMAIL')), array('edit_one', array('_SELF', array('type' => 'ed'), '_SELF'), do_lang('EDIT_WELCOME_EMAIL'))), do_lang('WELCOME_EMAILS'));
 }
Exemplo n.º 23
0
 /**
  * The do-next manager for before setup management.
  *
  * @return tempcode		The UI
  */
 function misc()
 {
     require_lang('quiz');
     require_lang('menus');
     $also_url = build_url(array('page' => 'cms_quiz'), get_module_zone('cms_quiz'));
     attach_message(do_lang_tempcode('ALSO_SEE_CMS', escape_html($also_url->evaluate())), 'inform');
     require_code('templates_donext');
     return do_next_manager(get_page_title('MANAGE_QUIZZES'), comcode_lang_string('DOC_QUIZZES'), array(array('findwinners', array('_SELF', array('type' => 'find_winner'), '_SELF'), do_lang('FIND_WINNERS')), array('survey_results', array('_SELF', array('type' => 'survey_results'), '_SELF'), do_lang('SURVEY_RESULTS')), array('export', array('_SELF', array('type' => 'export'), '_SELF'), do_lang('EXPORT_QUIZ'))), do_lang('MANAGE_QUIZZES'));
 }
Exemplo n.º 24
0
 /**
  * The do-next manager for before content management.
  *
  * @return tempcode		The UI
  */
 function misc()
 {
     $GLOBALS['HELPER_PANEL_PIC'] = 'pagepics/zones';
     $GLOBALS['HELPER_PANEL_TUTORIAL'] = 'tut_structure';
     require_code('templates_donext');
     return do_next_manager(get_page_title('ZONES'), comcode_lang_string('DOC_ZONES'), array(array('add_one', array('_SELF', array('type' => 'add'), '_SELF'), do_lang('ADD_ZONE')), array('edit_one', array('_SELF', array('type' => 'edit'), '_SELF'), do_lang('EDIT_ZONE'))), do_lang('ZONES'));
 }
 /**
  * The do-next manager for before content management.
  *
  * @return tempcode		The UI
  */
 function misc()
 {
     breadcrumb_set_parents(array(array('_SEARCH:admin_ocf_join:menu', do_lang_tempcode('MEMBERS'))));
     require_code('templates_donext');
     return do_next_manager(get_page_title('CUSTOM_PROFILE_FIELDS'), comcode_lang_string('DOC_CUSTOM_PROFILE_FIELDS'), array(array('add_one', array('_SELF', array('type' => 'ad'), '_SELF'), do_lang('ADD_CUSTOM_PROFILE_FIELD')), array('edit_one', array('_SELF', array('type' => 'ed'), '_SELF'), do_lang('EDIT_CUSTOM_PROFILE_FIELD'))), do_lang('CUSTOM_PROFILE_FIELDS'));
 }
Exemplo n.º 26
0
 /**
  * The do-next manager for before content management.
  *
  * @return tempcode		The UI
  */
 function misc()
 {
     require_code('templates_donext');
     return do_next_manager(get_page_title('CUSTOM_COMCODE'), comcode_lang_string('DOC_CUSTOM_COMCODE'), array(array('add_one', array('_SELF', array('type' => 'ad'), '_SELF'), do_lang('ADD_CUSTOM_COMCODE_TAG')), array('edit_one', array('_SELF', array('type' => 'ed'), '_SELF'), do_lang('EDIT_CUSTOM_COMCODE_TAG'))), do_lang('CUSTOM_COMCODE'));
 }
Exemplo n.º 27
0
 /**
  * The do-next manager for order module
  * 
  * @return tempcode		The UI
  */
 function misc()
 {
     breadcrumb_set_self(do_lang_tempcode('ORDERS'));
     breadcrumb_set_parents(array(array('_SEARCH:admin_ecommerce:ecom_usage', do_lang_tempcode('ECOMMERCE'))));
     require_code('templates_donext');
     return do_next_manager(get_page_title('ORDERS'), comcode_lang_string('DOC_ECOMMERCE'), array(array('show_orders', array('_SELF', array('type' => 'show_orders'), '_SELF'), do_lang('SHOW_ORDERS')), array('undispatched', array('_SELF', array('type' => 'show_orders', 'filter' => 'undispatched'), '_SELF'), do_lang('UNDISPATCHED_ORDERS'))), do_lang('ORDERS'));
 }
Exemplo n.º 28
0
 /**
  * Standard aed_module edit form filler.
  *
  * @param  ID_TEXT		The entry being edited
  * @return array			A tuple of lots of info
  */
 function fill_in_edit_form($_id)
 {
     $id = intval($_id);
     require_lang('menus');
     require_lang('zones');
     $GLOBALS['HELPER_PANEL_TEXT'] = comcode_lang_string('DOC_WRITING');
     $GLOBALS['HELPER_PANEL_PIC'] = '';
     $rows = $GLOBALS['SITE_DB']->query_select('news', array('*'), array('id' => intval($id)), '', 1);
     if (!array_key_exists(0, $rows)) {
         warn_exit(do_lang_tempcode('MISSING_RESOURCE'));
     }
     $myrow = $rows[0];
     $cat = $myrow['news_category'];
     $categories = array();
     $category_query = $GLOBALS['SITE_DB']->query_select('news_category_entries', array('news_entry_category'), array('news_entry' => $id));
     foreach ($category_query as $value) {
         $categories[] = $value['news_entry_category'];
     }
     $scheduled = mixed();
     if (addon_installed('calendar')) {
         $schedule_code = ':$GLOBALS[\'SITE_DB\']->query_update(\'news\',array(\'date_and_time\'=>$GLOBALS[\'event_timestamp\'],\'validated\'=>1),array(\'id\'=>' . strval($id) . '),\'\',1);';
         $past_event = $GLOBALS['SITE_DB']->query_select('calendar_events e LEFT JOIN ' . $GLOBALS['SITE_DB']->get_table_prefix() . 'translate t ON e.e_content=t.id', array('e_start_day', 'e_start_month', 'e_start_year', 'e_start_hour', 'e_start_minute'), array('text_original' => $schedule_code), '', 1);
         $scheduled = array_key_exists(0, $past_event) ? array($past_event[0]['e_start_minute'], $past_event[0]['e_start_hour'], $past_event[0]['e_start_month'], $past_event[0]['e_start_day'], $past_event[0]['e_start_year']) : NULL;
         if (!is_null($scheduled) && $scheduled < time()) {
             $scheduled = NULL;
         }
     } else {
         $scheduled = NULL;
     }
     list($fields, $hidden, , , , , $fields2) = $this->get_form_fields($cat, $categories, get_translated_text($myrow['title']), get_translated_text($myrow['news']), $myrow['author'], $myrow['validated'], $myrow['allow_rating'], $myrow['allow_comments'], $myrow['allow_trackbacks'], 0, $myrow['notes'], $myrow['news_image'], $scheduled);
     return array($fields, $hidden, new ocp_tempcode(), '', false, get_translated_text($myrow['news_article']), $fields2, get_translated_tempcode($myrow['news_article']));
 }
Exemplo n.º 29
0
 /**
  * The do-next manager for before content management.
  *
  * @return tempcode		The UI
  */
 function misc()
 {
     require_code('templates_donext');
     return do_next_manager(get_page_title('FLAGRANT_TEXT'), comcode_lang_string('DOC_FLAGRANT'), array(array('add_one', array('_SELF', array('type' => 'ad'), '_SELF'), do_lang('ADD_FLAGRANT')), array('edit_one', array('_SELF', array('type' => 'ed'), '_SELF'), do_lang('FLAGRANT_MANAGE'))), do_lang('FLAGRANT_TEXT'));
 }
Exemplo n.º 30
0
 /**
  * The do-next manager for before content management.
  *
  * @return tempcode		The UI
  */
 function misc()
 {
     if (has_actual_page_access(get_member(), 'admin_banners')) {
         $also_url = build_url(array('page' => 'admin_banners'), get_module_zone('admin_banners'));
         attach_message(do_lang_tempcode('menus:ALSO_SEE_ADMIN', escape_html($also_url->evaluate())), 'inform');
     }
     require_code('templates_donext');
     return do_next_manager(get_page_title('MANAGE_BANNERS'), comcode_lang_string('DOC_BANNERS'), array(has_specific_permission(get_member(), 'submit_cat_highrange_content', 'cms_banners') ? array('add_one_category', array('_SELF', array('type' => 'ac'), '_SELF'), do_lang('ADD_BANNER_TYPE')) : NULL, has_specific_permission(get_member(), 'edit_cat_highrange_content', 'cms_banners') ? array('edit_one_category', array('_SELF', array('type' => 'ec'), '_SELF'), do_lang('EDIT_BANNER_TYPE')) : NULL, has_specific_permission(get_member(), 'submit_midrange_content', 'cms_banners') ? array('add_one', array('_SELF', array('type' => 'ad'), '_SELF'), do_lang('ADD_BANNER')) : NULL, has_specific_permission(get_member(), 'edit_own_midrange_content', 'cms_banners') ? array('edit_one', array('_SELF', array('type' => 'ed'), '_SELF'), do_lang('EDIT_BANNER')) : NULL), do_lang('MANAGE_BANNERS'));
 }