Example #1
0
 function getURL()
 {
     if (!isset($this->id)) {
         return AMP_CONTENT_URL_PETITIONS;
     }
     return AMP_Url_AddVars(AMP_CONTENT_URL_PETITIONS, array('pid=' . $this->id));
 }
Example #2
0
 function _formFooter()
 {
     $renderer =& AMP_get_renderer();
     $current_section_edit_link = false;
     $current_class_edit_link = false;
     $base_footer = '&nbsp;&nbsp;<a href="' . AMP_Url_AddVars(AMP_SYSTEM_URL_ARTICLE, array('nosearch=1')) . '" class="standout">' . sprintf(AMP_TEXT_VIEW_ALL, AMP_pluralize(ucfirst(AMP_TEXT_ARTICLE))) . '</a>';
     //sectional edit link
     $current_section = isset($_REQUEST['section']) && $_REQUEST['section'] ? $_REQUEST['section'] : false;
     if (!$current_section) {
         $current_section = isset($_REQUEST['type']) && $_REQUEST['type'] ? $_REQUEST['type'] : false;
     }
     if ($current_section) {
         $section_names = AMPContent_Lookup::instance('sections');
         $section_name = isset($section_names[$current_section]) ? $section_names[$current_section] : false;
         $current_section_edit_link = $renderer->separator() . $renderer->link(AMP_Url_AddVars(AMP_SYSTEM_URL_SECTION, array('id=' . $current_section)), $renderer->image(AMP_SYSTEM_ICON_EDIT, array('width' => '16', 'height' => '16', 'border' => 0)) . $renderer->space() . AMP_TEXT_EDIT . $renderer->space() . AMP_TEXT_SECTION . $renderer->space() . AMP_trimText($section_name, 20, false));
     }
     //class edit link
     $current_class = isset($_REQUEST['class']) && $_REQUEST['class'] ? $_REQUEST['class'] : false;
     if ($current_class) {
         $class_names = AMPContent_Lookup::instance('classes');
         $class_name = isset($class_names[$current_class]) ? $class_names[$current_class] : false;
         $current_class_edit_link = $renderer->separator() . $renderer->link(AMP_Url_AddVars(AMP_SYSTEM_URL_CLASS, array('id=' . $current_class)), $renderer->image(AMP_SYSTEM_ICON_EDIT, array('width' => '16', 'height' => '16', 'border' => 0)) . $renderer->space() . AMP_TEXT_EDIT . $renderer->space() . AMP_TEXT_CLASS . $renderer->space() . AMP_trimText($class_name, 20, false));
     }
     return $base_footer . $current_section_edit_link . $current_class_edit_link . $renderer->newline();
 }
Example #3
0
 function getURL()
 {
     if (!isset($this->id)) {
         return false;
     }
     return AMP_Url_AddVars(AMP_CONTENT_URL_TAG, array('id=' . $this->id));
 }
Example #4
0
 function get_url_edit()
 {
     if (!(isset($this->id) && $this->id)) {
         return false;
     }
     return AMP_Url_AddVars(AMP_SYSTEM_URL_TOOLS, array('id=' . $this->id));
 }
Example #5
0
 function getLoginUrl($change_array = null)
 {
     if (!isset($change_array)) {
         return PHP_SELF_QUERY();
     }
     $vars = array_merge(AMP_Url_Values(), $change_array);
     return AMP_Url_AddVars($_SERVER['PHP_SELF'], $vars);
 }
Example #6
0
 function _getScheduleLink($data)
 {
     $baselink = AMP_Url_AddVars('schedule_item.php', 'action=list');
     if (!isset($this->schedule_lookup[$this->currentrow['action_id']])) {
         return $baselink;
     }
     return AMP_Url_AddVars($baselink, 'schedule_id=' . $this->schedule_lookup[$this->currentrow['action_id']]);
 }
Example #7
0
 function getTagURL()
 {
     $tag_id = $this->getTag();
     if (!$tag_id) {
         return false;
     }
     return AMP_Url_AddVars(AMP_CONTENT_URL_TAG, array('id=' . $tag_id));
 }
Example #8
0
 function _renderSectionHeader($section)
 {
     $section_header =& $section->getHeaderRef();
     if (!$section_header) {
         return false;
     }
     $section_header_url = AMP_Url_AddVars(AMP_SYSTEM_URL_ARTICLE, array('id=' . $section_header->id));
     return AMP_TEXT_SECTION_HEADER . ': ' . AMP_trimText($section_header->getName(), 30, false) . $this->_renderer->space(2) . $this->_renderer->link($section_header_url, '[ ' . AMP_TEXT_EDIT . ' ]' . $this->_renderer->space() . $this->_renderer->image(AMP_SYSTEM_ICON_EDIT, array('width' => '16', 'height' => '16', 'border' => '0'))) . $this->_renderer->newline();
 }
Example #9
0
 function _signupLink(&$source, $fieldname = null)
 {
     $form_id = $source->getFormId();
     if (!$form_id) {
         return false;
     }
     $renderer =& AMP_get_renderer();
     return $renderer->link(AMP_Url_AddVars(AMP_SYSTEM_URL_FORM_DATA, array('modin' => 'modin=' . $form_id)), AMP_TEXT_PETITION_SIGNERS);
 }
Example #10
0
 function _makeThumb(&$source, $column_name)
 {
     require_once 'AMP/Content/Image.inc.php';
     $img = $source->getTagImageRef();
     if (!$img) {
         return false;
     }
     return $this->inDiv($this->_HTML_image(AMP_Url_AddVars(AMP_SYSTEM_URL_IMAGE_VIEW, array('file=' . $img->getName(), 'class=' . AMP_IMAGE_CLASS_THUMB, 'height=30', 'action=resize')), $this->_thumb_attr), array('class' => 'tag_listing_icon'));
 }
Example #11
0
 function getURL()
 {
     if ($url = $this->getRedirect()) {
         return $url;
     }
     if (!$this->id) {
         return false;
     }
     return AMP_Url_AddVars(AMP_CONTENT_URL_ARTICLE, array("vid=" . $this->id, 'id=' . $this->getArticleId(), 'preview=1'));
 }
Example #12
0
 function _after_init_search($criteria = null)
 {
     $this->_pager_target = AMP_Url_AddVars(AMP_SYSTEM_URL_ARTICLE_COMMENT, array('action=search'));
     if (!isset($criteria)) {
         return false;
     }
     $article_id = isset($criteria['article']) ? $criteria['article'] : false;
     if ($article_id) {
         $this->_pager_target = AMP_Url_AddVars($this->_pager_target, array('article=' . $article_id));
     }
 }
Example #13
0
 function output()
 {
     if (!($class_set =& AMPContent_Lookup::instance('activeClasses'))) {
         return false;
     }
     $output = "";
     foreach ($class_set as $id => $name) {
         $output .= $this->_renderer->link(AMP_Url_AddVars(AMP_SYSTEM_URL_ARTICLE, array('class' => 'class=' . $id, 'AMPSearch' => 'AMPSearch=1')), $name) . $this->_renderer->newline();
         //$output .= '<a href = "article_list.php?class='. $id . '">'. $name . "</a><BR>\n";
         //$output .= '<a href = "article_list.php?class='. $class_id . '">'. $class_set[ $class_id ] . "</a> ( ".  $class_count ." ) <BR>\n";
     }
     return $output;
 }
Example #14
0
 function _after_init_search($criteria = null)
 {
     $this->_url_add = AMP_Url_AddVars(AMP_SYSTEM_URL_ARTICLE_COMMENT, array('action=add'));
     if (!isset($criteria)) {
         return false;
     }
     $article_id = isset($criteria['article_id']) ? $criteria['article_id'] : false;
     $userdata_id = isset($criteria['userdata_id']) ? $criteria['userdata_id'] : false;
     if ($article_id) {
         $this->_url_add = AMP_Url_AddVars($this->_url_add, array('article_id=' . $article_id));
     }
     if ($userdata_id) {
         $this->_url_add = AMP_Url_AddVars($this->_url_add, array('userdata_id=' . $userdata_id));
     }
 }
Example #15
0
 function _listLink($options = array())
 {
     if (!isset($options['_linked_uid'])) {
         return false;
     }
     $comment_count_lookup = FormLookup::instance('commentCounts');
     $comment_count = isset($comment_count_lookup[$options['_linked_uid']]) ? $comment_count_lookup[$options['_linked_uid']] : 0;
     $link_text = ($comment_count ? $comment_count : AMP_TEXT_NO) . '&nbsp;' . AMP_pluralize(AMP_TEXT_COMMENT);
     $renderer =& $this->_get_renderer();
     //current comment count
     $comments = $renderer->link(AMP_Url_AddAnchor(AMP_Url_AddVars(PHP_SELF_QUERY(), array('uid=' . $options['_linked_uid'])), 'comments'), $link_text);
     //add comment link
     $comments .= $renderer->separator() . $renderer->link(AMP_Url_AddVars(AMP_CONTENT_URL_COMMENT_ADD, array('userdata_id=' . $options['_linked_uid'])), AMP_TEXT_ADD);
     return $comments . $renderer->newline(2);
 }
Example #16
0
 function _after_init_search($criteria = null)
 {
     $this->_url_add = AMP_Url_AddVars(AMP_SYSTEM_URL_ARTICLE, array('action=add'));
     if (!isset($criteria)) {
         return false;
     }
     $section_id = isset($criteria['section']) ? $criteria['section'] : (isset($criteria['type']) ? $criteria['type'] : false);
     $class_id = isset($criteria['class']) ? $criteria['class'] : false;
     if ($section_id) {
         unset($this->_sort_default['type']);
         $this->_url_add = AMP_Url_AddVars($this->_url_add, array('section=' . $section_id));
     }
     if ($class_id) {
         $this->_url_add = AMP_Url_AddVars($this->_url_add, array('class=' . $class_id));
     }
 }
Example #17
0
 function init_settings()
 {
     $domain = explode('/', AMP_SITE_URL);
     $website = explode('/', AMP_SITE_URL, 3);
     $inits = array('website' => $website[2], 'domain' => $domain[3], 'public_baseurl' => AMP_Url_AddVars(AMP_SITE_URL, 'q=phplist'));
     foreach ($inits as $key => $value) {
         $this->_dbcon->Execute(sprintf('REPLACE INTO ' . PHPLIST_TABLE_CONFIG . ' (item, value) VALUES (\'%s\', \'%s\')', $key, $value));
     }
     //variable_set('phplist_version', '2.8.11');
     //  $group = form_item('', t('If you are on a shared host, it will probably be appreciated if you don\'t send out loads of emails in one go. To do this, you can configure batch processing. Please note, the following two values can be overridden by your ISP by using a server wide configuration. So if you notice these values to be different in reality, that may be the case'));
     //  $group .= form_textfield(t('Batch email size'), 'phplist_batch_size', variable_get('phplist_batch_size', 0), 40, 40, t('Define the amount of emails you want to send per period. If 0, batch processing is disabled'));
     //  $group .= form_textfield(t('Batch email period'), 'phplist_batch_period', variable_get('phplist_batch_period', 3600), 40, 40, t('Define the length of one batch processing period, in seconds (3600 is an hour)'));
     //  $group .= form_checkbox(t('Cron queue processing'), 'phplist_cron_enable', 1, variable_get('phplist_cron_enable', 0), t('Checked: when cron is called the message queue will be processed.'));
     //  $output .= form_group(t('Batch Processing'), $group);
     return $output;
 }
Example #18
0
 function display_response()
 {
     $renderer =& new AMPDisplay_HTML();
     $this->message(sprintf(AMP_TEXT_DATA_SAVE_SUCCESS, AMP_TEXT_YOUR_COMMENT));
     if ($this->_article_id) {
         AMP_lookup_clear_cached('comments_live_by_article', $this->_article_id);
         ampredirect(AMP_Url_AddVars(AMP_CONTENT_URL_ARTICLE, array('id=' . $this->_article_id)));
     }
     if ($this->_userdata_id) {
         require_once 'AMP/UserData/Lookups.inc.php';
         $form_id_lookup =& FormLookup::instance('modin');
         if (isset($form_id_lookup[$this->_userdata_id])) {
             $target_modin = $form_id_lookup[$this->_userdata_id];
             ampredirect(AMP_Url_AddVars(AMP_CONTENT_URL_FORM_DISPLAY, array('uid=' . $this->_userdata_id, 'modin=' . $target_modin)));
         }
     }
 }
Example #19
0
 function _update_list_location(&$controller)
 {
     $model =& $controller->get_model();
     $new_data = $_POST;
     $display_class = strtolower($this->components['list']);
     $list_location_cookie = $display_class . '_ListLocation';
     //frontpage content special action
     if (isset($new_data['class']) && $new_data['class'] == AMP_CONTENT_CLASS_FRONTPAGE) {
         ampredirect(AMP_SYSTEM_URL_ARTICLE_FRONTPAGE);
     }
     //default list behavior
     if (isset($new_data['section']) && (!(isset($new_data['id']) && $new_data['id']) || !(isset($_COOKIE[$list_location_cookie]) && $_COOKIE[$list_location_cookie]))) {
         ampredirect(AMP_Url_AddVars(AMP_SYSTEM_URL_ARTICLE, array('section=' . $new_data['section'])));
         return;
     }
     if (isset($new_data['class']) && $model->getClass() != $new_data['class']) {
         $controller->update_list_location($new_data['class'], 'class');
     }
     if (isset($new_data['section']) && $model->getSection() != $new_data['section']) {
         $controller->update_list_location($new_data['section'], 'section');
     }
 }
Example #20
0
 function commit_save()
 {
     //just-in-time Build call is a performance optimization, sorry for the repetitive code
     $this->_init_form();
     //check if form validation succeeds
     if (!$this->_form->validate()) {
         $this->_display->add($this->_form, 'form');
         return false;
     }
     require_once 'AMP/Content/Article.inc.php';
     $this->_model =& new Article(AMP_Registry::getDbcon());
     $this->_model->setDefaults();
     $this->_model->mergeData($this->get_form_data());
     //attempt to save the submitted data
     if (!$this->_model->save()) {
         $this->error($this->_model->getErrors());
         $this->_display->add($this->_form);
         return false;
     }
     $this->_model_id = $this->_model->id;
     $this->message(sprintf(AMP_TEXT_DATA_SAVE_SUCCESS, $this->_model->getName()));
     $this->_form->postSave($this->_model->getData());
     $this->redirect(AMP_Url_AddVars(AMP_SYSTEM_URL_CONTENTS, array('type=' . $this->_model->getSection(), 'AMPSearch=Search')));
 }
Example #21
0
 function _renderSectionHeader($article)
 {
     $section_header_lookup = AMPContent_Lookup::instance('sectionHeaders');
     $section_id = array_search($article->id, $section_header_lookup);
     if (!$section_id) {
         return false;
     }
     $section_url = AMP_SITE_URL . AMP_Url_AddVars(AMP_CONTENT_URL_ARTICLE, array('list=type', 'type=' . $section_id));
     $section_names_lookup = AMP_lookup('sections');
     $section_name = isset($section_names_lookup[$section_id]) ? $section_names_lookup[$section_id] : false;
     return $this->_renderer->inSpan(AMP_TEXT_SECTION_HEADER . ': ' . $this->_renderer->link($section_url, $section_name, array('target' => 'blank'))) . $this->_renderer->newline();
 }
<?php

require_once 'AMP/System/Base.php';
$modid = isset($_GET['modid']) && $_GET['modid'] ? $_GET['modid'] : false;
if (!$modid) {
    ampredirect(AMP_SYSTEM_URL_HOME);
}
if ($modid) {
    ampredirect(AMP_Url_AddVars(AMP_SYSTEM_URL_TOOLS, 'id=' . $modid));
}
Example #23
0
 function _displayImageURL()
 {
     $image_url = AMP_Url_AddVars(AMP_SYSTEM_URL_IMAGE_VIEW, array('filename=' . urlencode($this->_image->getName()), 'class=' . AMP_IMAGE_CLASS_ORIGINAL));
     if ($this->_display_ratio == 1) {
         return $image_url;
     }
     return AMP_Url_AddVars($image_url, array('action=resize', 'height=' . $this->_display_height, 'width=' . $this->_display_width));
 }
Example #24
0
 function _setSortGalleryLinks(&$source, $sort_direction)
 {
     ampredirect(AMP_Url_AddVars(AMP_SYSTEM_URL_GALLERY_IMAGES, 'sort=galleryid'));
 }
Example #25
0
 function offsetURL($new_offset)
 {
     $page_url_vars = array();
     if ($new_offset) {
         $page_url_vars['offset'] = 'offset=' . $new_offset;
     }
     if ($this->_qty != $this->_default_qty) {
         $page_url_vars['qty'] = 'qty=' . $this->_qty;
     }
     if (!isset($this->_url_target)) {
         $this->_url_target = $_SERVER['PHP_SELF'];
     }
     if (strpos($this->_url_target, '//') === 0) {
         $this->_url_target = substr($this->_url_target, 2);
     }
     return AMP_Url_AddVars($this->_url_target, array_merge($this->_getURLValues(), $page_url_vars));
 }
Example #26
0
    function _RDF_trackbacks($article_id)
    {
        if (!AMP_CONTENT_TRACKBACKS_ENABLED) {
            return false;
        }
        require_once 'AMP/Content/Article.inc.php';
        AMP_config_load('urls');
        $article = new Article($this->comment_set->dbcon, $article_id);
        return '<!--
            <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                     xmlns:dc="http://purl.org/dc/elements/1.1/"
                     xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">

            <rdf:Description
                rdf:about="' . AMP_SITE_URL . $article->getURL() . '"
                dc:identifier="' . AMP_SITE_URL . $article->getURL() . '"
                dc:title="' . $article->getTitle() . '"
                trackback:ping="' . AMP_Url_AddVars(AMP_SITE_URL . AMP_CONTENT_URL_TRACKBACKS, 'id=' . $article_id) . '" />
            </rdf:RDF>
            -->';
    }
Example #27
0
<?php
require_once( 'AMP/System/Base.php');
$modid = isset( $_GET['modid'] ) && $_GET['modid'] ? $_GET['modid'] : false;
$control_id = isset( $_GET['id'] ) && $_GET['id'] ? $_GET['id'] : false;

if ( !$modid ) ampredirect( AMP_SYSTEM_URL_HOME );
if ( $modid ) ampredirect( AMP_Url_AddVars( AMP_SYSTEM_URL_TOOL_CONTROL, array( 'id='.$control_id )));

/*

require_once("Connections/freedomrising.php");
require_once("Connections/sysmenu.class.php");
$obj = new SysMenu; 
$buildform = new BuildForm;

$table = "module_control";
$listtitle ="Settings";
$listsql ="select id, description, setting   from $table  ";
$orderby =" order by  description asc  ";
$fieldsarray=array( 'Setting'=>'description','Value'=>'setting');
$filename="module_control.php";

ob_start();
// insert, update, delete
if ((($_POST['MM_update']) && ($_POST['MM_recordId'])) or ($_POST['MM_insert']) or (($_POST['MM_delete']) && ($_POST['MM_recordId']))) {

    $MM_editTable  = $table;
    $MM_recordId = $_POST['MM_recordId'];
    $MM_editRedirectUrl = "module_control_list.php?modid=".$_POST['modid'];
	$MM_editColumn = "id";
    $MM_fieldsStr =  "modid|value|var|value|display|value|description|value|setting|value";
Example #28
0
 function _menuItemArticleList($section_id)
 {
     return array('id' => $section_id, 'label' => AMP_trimText(AMP_clearSpecialChars($this->getName($section_id)), 80) . " ( " . $this->getTotals($section_id) . " )", 'href' => AMP_Url_AddVars(AMP_SYSTEM_URL_ARTICLE, array('section=' . $section_id)));
 }
Example #29
0
 function _buildActions()
 {
     $urlvars = AMP_URL_Values();
     $urlvars['printsafe'] = 'printsafe=1';
     $actions = array();
     $actions['email'] = array('image' => '<img src="img/email.gif" align="top">', 'link' => '<a href="javascript:openform(\'mailto.php\')"  class="' . $this->css_class . '">E-Mail Page</a>');
     if (!($this->content_type == AMP_CONTENT_PAGETYPE_ARTICLE || $this->content_type == AMP_CONTENT_PAGETYPE_LIST)) {
         return $actions;
     }
     $actions['print'] = array('image' => '<img src="/img/print.gif" align="top">', 'link' => '<a href="' . AMP_Url_AddVars(AMP_CONTENT_URL_ARTICLE, $urlvars) . '" class="' . $this->css_class . "\">Printer Safe</a>");
     return $actions;
 }
Example #30
0
 function update_list_location($item_id, $location_item)
 {
     $list_location_cookie = $this->_get_cookie_name_bookmark();
     $list_location_var = $location_item . '=' . $item_id;
     if (!(isset($_COOKIE[$list_location_cookie]) && $_COOKIE[$list_location_cookie])) {
         return false;
     }
     //confirm that existing cookie is for a similar search
     if (strpos($_COOKIE[$list_location_cookie], $location_item) && !strpos($_COOKIE[$list_location_cookie], $location_item . '&')) {
         $new_url = AMP_Url_AddVars(AMP_SYSTEM_URL_ARTICLE, $list_location_var);
         ampredirect($new_url);
     }
 }