コード例 #1
0
ファイル: Wysiwyg.php プロジェクト: radicaldesigns/amp
 function __construct($id = null)
 {
     $this->_header = AMP_get_header();
     $this->_renderer = AMP_get_renderer();
     if (!empty($id)) {
         $this->identify($id);
     }
 }
コード例 #2
0
ファイル: Display.php プロジェクト: radicaldesigns/amp
 function _init_header()
 {
     $header =& AMP_get_header();
     $header->addStylesheet('scripts/listmenu_fallback.css', 'fsmenu-fallback');
     $header->addStylesheet('scripts/listmenu_h.css');
     $header->addJavaScript('scripts/fsmenu_commented.js');
     $header->addJavaScript('scripts/fsmenu_config.js');
     $basic_script = "                var arrow = null;\n                if (document.createElement && document.documentElement)\n                {\n                     arrow = document.createElement('span');\n                     arrow.appendChild(document.createTextNode('>'));\n                     arrow.className = 'subind';\n                }\n                listMenu.activateMenu(\"" . $this->menu_id . "\", arrow);\n";
     $header->addJavascriptOnLoad($basic_script);
 }
コード例 #3
0
ファイル: Form.inc.php プロジェクト: radicaldesigns/amp
 function _after_init()
 {
     #$this->addTranslation( 'date', '_makeDbDateTime', 'get' );
     #$this->addTranslation( 'date_start', '_makeDbDateTime', 'get' );
     #$this->addTranslation( 'date_end', '_makeDbDateTime', 'get' );
     $header =& AMP_get_header();
     $header->addJavascript('scripts/related.js', 'related_form');
     $header->addJavascriptOnload('RelatedQuestions = RelatedForm.create( document.forms["Quiz"], Array( "question", "explanation", "correct_answer", "answer_1", "answer_2", "answer_3", "answer_4", "answer_5", "answer_6", "answer_7"), "quiz", 31 );', 'load_related_qs');
     $this->addTranslation('modin', '_make_new_quiz_form', 'get');
     $this->addTranslation('modin', '_set_quiz_form', 'set');
     $this->addTranslation('questions', '_save_questions', 'get');
     #$header->addJavascriptDynamic(  'Event.observe( window, "load", function( ) {Event.observe( document.forms["Quiz"] , "submit", function(e ) { RelatedQuestions.prepare_submit( ); });});', 'related_form_submit');
 }
コード例 #4
0
ファイル: Detail.php プロジェクト: radicaldesigns/amp
    function _init_attributes()
    {
        $css = <<<STYLESHEET
img.thumb {
    border:0;
    width: %spx;
    max-height: 300px;
}
STYLESHEET;
        $css = sprintf($css, AMP_IMAGE_WIDTH_THUMB);
        $header =& AMP_get_header();
        $header->addStylesheetDynamic($css, strtolower(get_class($this)));
    }
コード例 #5
0
ファイル: Save.inc.php プロジェクト: radicaldesigns/amp
 function _register_fields_dynamic()
 {
     $header =& AMP_get_header();
     $header->addJavascript('scripts/ajax/prototype.js', 'prototype');
     $header->addJavascript('scripts/related.js', 'related_form');
     $options = $this->getOptions();
     if (!(isset($options['related_form_id']) && $options['related_form_id'])) {
         trigger_error(sprintf(AMP_TEXT_ERROR_NOT_DEFINED, get_class($this), 'related_form_id'));
         return;
     }
     //$related_udm = new UserData( $this->dbcon, $options['related_form_id'], $this->udm->admin );
     $related_udm = new UserData($this->dbcon, $options['related_form_id']);
     $this->add_div['default'] = sprintf($this->add_div['default'], $options['related_form_id']);
     $this->fields['add_div'] = $this->add_div;
     $this->_included_fieldnames = isset($options['included_fields']) && $options['included_fields'] ? preg_split("/\\s{0,2},\\s{0,2}/", $options['included_fields']) : array_keys($related_udm->fields);
     $included_fields = array_combine_key($this->_included_fieldnames, $related_udm->fields);
     $this->fields = array_merge($this->fields, $included_fields);
     $dom_field_names = $this->convertFieldNamestoUDM($included_fields, $keys = true);
     # there must be a better way than this, but this field was causing problems
     # in the javascript, and since we ignore it's value on submit anyway...
     if (false !== ($owner_key = array_search($this->_field_prefix . '_' . $options['related_form_owner_field'], $dom_field_names))) {
         unset($dom_field_names[$owner_key]);
     }
     $add_button_targets = join("', '", $dom_field_names);
     $this->add_button['attr']['onClick'] = sprintf($this->_related_add_script_template, '\'' . $add_button_targets . '\'', $options['badge_description'], $options['related_form_id'], $this->_field_prefix);
     $this->fields['add_button'] = $this->add_button;
     #XXX: this appears to be trying to preserve values, why is it not working?
     $load_single_request_script = str_replace('this.form', 'document.forms["' . $this->udm->name . '"]', $this->_related_add_script_template);
     $request_keys = array();
     foreach ($dom_field_names as $dom_field) {
         if (isset($_POST[$dom_field]) && is_array($_POST[$dom_field])) {
             foreach ($_POST[$dom_field] as $key => $value) {
                 //$this->fields[str_replace( $this->_field_prefix .'_', '', $dom_field ).'['.$key.']'] = $this->_hidden_def;
                 $field_key = str_replace($this->_field_prefix . '_', '', $dom_field) . '[' . $key . ']';
                 $this->fields[$field_key] = $this->_hidden_def;
                 $request_keys[$key][] = $dom_field . '[' . $key . ']';
             }
         }
     }
     $load_request_script = '';
     foreach ($request_keys as $key => $request_item) {
         $load_request_targets = join("', '", $request_item);
         $load_request_script .= sprintf($load_single_request_script, '\'' . $load_request_targets . '\'', $options['badge_description'], $options['related_form_id'], $this->_field_prefix) . "\n";
     }
     if ($load_request_script) {
         $header->addJavascriptOnLoad($load_request_script);
     }
     if (isset($this->udm->form)) {
         $this->udm->form->setAttribute('onSubmit', 'related_add( this, Array( \'' . $add_button_targets . '\'));');
     }
 }
コード例 #6
0
ファイル: Rating.php プロジェクト: radicaldesigns/amp
function amp_badge_rating_block($options)
{
    $page =& AMPContent_Page::instance();
    $article = $page->getArticle();
    if (!$article) {
        return false;
    }
    $header =& AMP_get_header();
    $header->addJavaScript('/scripts/rating.js', 'ratings');
    $header->addJavaScript('/scripts/ajax/prototype.js', 'prototype');
    $header->addJavascriptOnload("new Ajax.Updater( 'rating', '/badge_widget.php?id=10&cache=0&format=xml&article_id=" . $article->id . "' );", 'ratings_loader');
    $display = new Rating_Public_Display($article);
    return $display->render_block($article);
}
コード例 #7
0
ファイル: Display.php プロジェクト: radicaldesigns/amp
 function _renderFooter()
 {
     $tab_add = "PopularDisplay.add( '%1\$s_display', '%1\$s_trigger');";
     $tab_script = array();
     $tab_trigger = '';
     foreach (array_filter($this->tabs_active) as $type => $active) {
         $tab_script[] = sprintf($tab_add, $type);
         if (!$tab_trigger) {
             $tab_trigger = "PopularDisplay.show( \$( '" . $type . "_trigger'))";
         }
     }
     if (count($tab_script) < 2) {
         return;
     }
     $tab_script[] = $tab_trigger;
     $script = "PopularDisplay = AMP_simple_tabs( );\n" . join("\n", $tab_script);
     $header =& AMP_get_header();
     $header->addJavaScript('scripts/tabs.js', 'tabs');
     $header->addJavascriptOnLoad($script, 'tabs_load');
 }
コード例 #8
0
ファイル: Form.inc.php プロジェクト: radicaldesigns/amp
 function _init_sectional_script()
 {
     $map = AMPContent_Map::instance();
     $start_group = $map->getChildren(AMP_CONTENT_MAP_ROOT_SECTION);
     $start_group = $map->getAllParents();
     $script_output = '';
     foreach ($start_group as $section_id) {
         if ($section_id == AMP_CONTENT_MAP_ROOT_SECTION) {
             continue;
         }
         $children = $map->getChildren($section_id);
         if (!$children) {
             continue;
         }
         $script_output .= 'document.forms["' . $this->formname . '"].elements["sections[' . $section_id . ']"].onchange=function( ) {' . "\n" . $this->_init_sectional_children($children, $map) . '};' . "\n\n";
     }
     $script_output = 'function init_section_checkbox_cascade( ) { ' . "\n" . $script_output . "\n" . '}';
     $header = AMP_get_header();
     $header->addJavascriptDynamic($script_output, 'section_checkboxes');
     $header->addJavascriptOnload('init_section_checkbox_cascade( );');
 }
コード例 #9
0
ファイル: mailto.php プロジェクト: radicaldesigns/amp
<?php

/*********************
05-07-2003  v3.01
Module:  Mailto
Description:  popup that sends email link to page
SYS VARS:  $SiteName
To Do:  make multiple var pages send
			  add design and css to page

*********************/
require_once 'AMP/Base/Config.php';
require_once 'Modules/Share/Public/ComponentMap.inc.php';
$intro_id = 22;
$map = new ComponentMap_Share_Public();
$controller = $map->get_controller();
$controller->_form->action = "mailto.php";
$header = AMP_get_header();
$flash =& AMP_System_Flash::instance();
$header->addStylesheet('custom/styles.css');
print $header->output();
print $flash->execute();
print $controller->execute();
コード例 #10
0
ファイル: Cloud.php プロジェクト: radicaldesigns/amp
 function _init_css()
 {
     if (!AMP_CONTENT_CLOUD_DYNAMIC_CSS) {
         return;
     }
     $css_source = '';
     for ($n = 0; $n < $this->_size_steps; $n++) {
         $css_source .= '.' . $this->_css_class_base . ($n + 1) . '{' . "\n" . 'font-size: ' . (1 + 0.25 * ($this->_size_steps - $n)) . 'em;' . "\n" . 'color: #FFFFFF;' . "\n" . '}' . "\n";
     }
     $header =& AMP_get_header();
     $header->addStylesheetDynamic($css_source, 'AMP_cloud' . get_class($this));
 }
コード例 #11
0
ファイル: List.php プロジェクト: radicalsuz/amp
    function render_toolbar_trash(&$toolbar)
    {
        $tool_name = $toolbar->submitGroup . '[trash]';
        $label = AMP_TEXT_TRASH;
        $header =& AMP_get_header();
        $confirm_script = <<<CONFIRM_SCRIPT
        jq( function() {
          jq(':submit[name*=amp_content_section_list][name*=trash]').click( function() {
            var section_names = jq.makeArray( jq('#amp_content_section_list tr.selected').map(function() { 
              return jq.trim(jq('td:eq(2)', this).text()); 
            })).join('\\n\\n');
            return confirmSubmit( "%s\\n\\n" + section_names + "\\n\\n%s" );
          });
        } );
CONFIRM_SCRIPT;
        $confirm_script = sprintf($confirm_script, AMP_TEXT_LIST_CONFIRM_DELETE_SECTIONS, AMP_TEXT_LIST_CONFIRM_DELETE);
        $header->addJavascriptDynamic($confirm_script, 'trash_button');
        return $this->_renderer->submit($tool_name, $label) . $this->_renderer->space();
    }
コード例 #12
0
ファイル: Form.inc.php プロジェクト: radicaldesigns/amp
 function _initJavascriptActions()
 {
     $header =& AMP_get_header();
     $this->_initPrettyUrlCreation($header);
 }
コード例 #13
0
ファイル: Toolbar.inc.php プロジェクト: radicaldesigns/amp
 function _initListTabs()
 {
     $list_popup_script = '';
     foreach ($this->_tabs as $tab_name) {
         $list_popup_script .= "if ( exempt_tab_name != '" . $tab_name . "' && ( \$(\"" . $tab_name . "\").style.display==\"block\") ) window.change_any( \"" . $tab_name . "\");\n";
     }
     $script = "\nfunction clearListTabs( exempt_tab_name ) {\n" . $list_popup_script . "\n}";
     $header =& AMP_get_header();
     $header->addJavascriptDynamic($script, 'list_tabs_clear');
 }
コード例 #14
0
ファイル: Values.php プロジェクト: radicaldesigns/amp
 function _renderJavascript()
 {
     $header = AMP_get_header();
     $header->addJavascript('/scripts/nav_layouts.js', 'nav_layouts');
 }
コード例 #15
0
ファイル: nav_widget.php プロジェクト: radicaldesigns/amp
$intro_id = isset($_GET['intro_id']) && $_GET['intro_id'] ? intval($_GET['intro_id']) : false;
$position = isset($_GET['position']) && $_GET['position'] ? $_GET['position'] : false;
$format = isset($_GET['format']) && $_GET['format'] ? $_GET['format'] : false;
if (!$position) {
    trigger_error('no position requested for ' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']);
    exit;
}
require_once 'AMP/BaseTemplate.php';
$current_page =& AMPContent_Page::instance();
require_once 'AMP/Content/Template.inc.php';
require_once 'AMP/Content/Nav/Manager.inc.php';
$template = new AMPContent_Template(AMP_Registry::getDbcon(), $current_page->getTemplateId());
if (!$template->hasData()) {
    return false;
}
$header =& AMP_get_header();
$standard_js = $header->_HTML_javaScripts();
$template->setPage($current_page);
$template->globalizeNavLayout();
$nav_manager = new NavigationManager($template, $current_page);
$nav_output = $nav_manager->output(strtoupper(substr($position, 0, 1)));
$new_js = $header->_HTML_javascripts();
$nav_js = array_diff(split("\n", $new_js), split("\n", $standard_js));
$nav_output = $nav_output . join("\n", $nav_js);
/*
$url = AMP_SITE_URL;

$pattern = '/href\s?=\s?\'((?!http)[\w\d\.\/?= -]*)\'/i';
$replace = 'href="'.$url.'/$1"';
$data =  preg_replace($pattern, $replace, $nav_output);
コード例 #16
0
ファイル: List.php プロジェクト: radicaldesigns/amp
    function render_js_table_rows_ui()
    {
        $hover_class = 'list_row_hover';
        $script = <<<SCRIPT
//checkbox select on row click
Event.observe( document, 'dom:loaded', function( ){
    Event.observe( \$( '{$this->list_id}'),'click', function( e ){
        var checkbox, row = e.findElement( 'tr')
        if ( row )  {
            var checkbox = row.down( 'input.list_select' );
            if ( checkbox) {
                if ( e.target != checkbox) checkbox.checked = !checkbox.checked;
                row.toggleClassName( 'selected' );
            }
        }
    });
    //row highlighting for IE
    Element.select( \$( '{$this->list_id}'), '.list_row').each( function( el ){
        Event.observe( el, 'mouseover', function( e ){ e.findElement( 'tr').addClassName( '{$hover_class}')}) ;
        Event.observe( el, 'mouseout', function( e ){ e.findElement( 'tr').removeClassName( '{$hover_class}')}) ;
        if( el.down( 'input.list_select').checked ) el.addClassName( 'selected');

    });
    //select all script
    Event.observe( \$( '{$this->list_id}_select_all_control'), 'click', function( e ) {
        first_item  = \$( "{$this->list_id}").down( 'tr', 1 ).down( 'input.list_select');
        if ( !first_item ) return;
        new_value = !first_item.checked; 
        \$( "{$this->list_id}").select( ".list_row").each( function( row ) { 
            var slbx = row.down( "input.list_select");
            if ( slbx ) {
                slbx.checked=new_value; 
                if( new_value ) { 
                    row.addClassName( "selected"); 
                } else {
                    row.removeClassName( "selected"); 
                }
            }

        }); 
    });

});
SCRIPT;
        $header = AMP_get_header();
        $header->addJavascriptDynamic($script, $this->list_id . 'table_rows');
    }
コード例 #17
0
ファイル: Form.php プロジェクト: radicaldesigns/amp
 function _initJavascriptActions()
 {
     $header = AMP_get_header();
     $header->addJavascriptOnload('new Ajax.Autocompleter( "event", "event_list", "ajax_request.php", {} );');
 }
コード例 #18
0
ファイル: Display.php プロジェクト: radicaldesigns/amp
 function _renderJavascript()
 {
     $header = AMP_get_header();
     $header->addJavaScript('/scripts/ajax/prototype.js', 'prototype');
     $header->addJavaScript('/scripts/ajax/scriptaculous.js?load=effects', 'scriptaculous');
     $header->addJavaScript('/scripts/lightbox/js/lightbox.js', 'lightbox');
     $header->addExtraHtml('<link rel="stylesheet" href="http://local_pink.org/scripts/lightbox/css/lightbox.css" type="text/css" media="screen" />');
 }
コード例 #19
0
ファイル: Display.php プロジェクト: radicaldesigns/amp
 function _init_javascript()
 {
     $header =& AMP_get_header();
     $header->addJavascript('scripts/rating.js', 'rating');
 }