Plugin Directory

Changeset 1369147


Ignore:
Timestamp:
03/11/2016 11:43:15 AM (10 years ago)
Author:
WebTechGlobal
Message:

Displaying Tweets on Updates page is easier.

Location:
wtg-portal-manager/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • wtg-portal-manager/trunk/classes/class-configuration.php

    r1359302 r1369147  
    158158 
    159159    /**
    160     * INTRO
    161     *
    162     * GUIDE
     160    * This function returns official post formats found
     161    * in the WordPress core and custom ones.
     162    *
     163    * The things is WP does not currently allow custom ones
     164    * properly.
     165    *
     166    * The data is used as page purposes in plugins like
     167    * WTG Portal Manager. The purpose of a page allows us
     168    * to apply functionality and not just layout. Default
     169    * content is one use.
    163170    *
    164171    * @author Ryan R. Bayne
    165172    * @package WebTechGlobal WordPress Plugins
    166     * @version 1.0
     173    * @version 1.1
    167174    */
    168175    public function postformats() {
     
    260267            'description' => __( 'This format will turn an array of product features into a list. Different levels of detail available so create a good array.', 'wtgportalmanager' )   
    261268        );
    262                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
     269   
    263270        $pf['updates'] = array(
    264271            'title' => __( 'Updates', 'wtgportalmanager' ),
     
    297304        );
    298305       
     306        // Added March 2016
     307        $pf['information'] = array(
     308            'title' => __( 'Information', 'wtgportalmanager' ),
     309            'wpsupported' => false,
     310            'description' => __( 'General information, other, misc or holding page.', 'wtgportalmanager' )   
     311        );
     312       
     313        // Added March 2016       
     314        $pf['steps'] = array(
     315            'title' => __( 'Steps', 'wtgportalmanager' ),
     316            'wpsupported' => false,
     317            'description' => __( 'Meant for a list of step by step instructions with the intention of offering some sort of functionality per step and tracking the users progress.', 'wtgportalmanager' )   
     318        );
     319               
     320        // Added March 2016       
     321        $pf['datatable'] = array(
     322            'title' => __( 'Data Table', 'wtgportalmanager' ),
     323            'wpsupported' => false,
     324            'description' => __( 'Use for a view that focuses on offering a table of data. The intention is to offer highly interactive tables supported with Ajax.', 'wtgportalmanager' )   
     325        );
     326               
     327        // Added March 2016       
     328        $pf['index'] = array(
     329            'title' => __( 'Index', 'wtgportalmanager' ),
     330            'wpsupported' => false,
     331            'description' => __( 'Use for organized lists of related links with format applicable to the main subject if there is one. The intential of this format is to automatically administrate the index when pages are deleted or created with certain parents or even keywords.', 'wtgportalmanager' )   
     332        );
     333               
     334        // Added March 2016       
     335        $pf['people'] = array(
     336            'title' => __( 'People', 'wtgportalmanager' ),
     337            'wpsupported' => false,
     338            'description' => __( 'Use for to maintain a list of users related to something. It could be a list of donators, contributors or reference to developers who took part in a project. The key functionality is that WordPress user data is used to fill the
     339            content.', 'wtgportalmanager' )   
     340        );
     341       
    299342        return $pf;   
    300343    }   
  • wtg-portal-manager/trunk/classes/class-requests.php

    r1365903 r1369147  
    628628    * @package WTG Portal Manager
    629629    * @since 0.0.1
    630     * @version 1.0
     630    * @version 1.1
    631631    */
    632632    public function createnewportalpage() {
     
    638638           
    639639            if( $format == $_POST['pagepurpose'] ) {
     640                $readable_purpose = $meta['title']; 
     641            }
     642 
     643        }       
     644   
     645        // Get current portals name to use as the title.
     646        $project_name = $this->DB->get_project_name( $project_id );
     647       
     648        // Build Page Title
     649        $title = $project_name . ' ' .  $readable_purpose;
     650         
     651        // Create post object.                                     
     652        $my_post = array(
     653          'post_title'    => wp_strip_all_tags( $title ),
     654          'post_content'  => __( 'Under Construction', 'wtgportalmanager' ),
     655          'post_status'   => 'publish',
     656          'post_author'   => get_current_user_id(),
     657          'post_type'     => 'page'
     658        );
     659         
     660        // Insert the post into the database.
     661        $post_id = wp_insert_post( $my_post );
     662       
     663        if( !$post_id || !is_numeric( $post_id ) ) {
     664            // Failure Output
     665            $this->UI->create_notice( __( "WordPress could not create a new post using wp_insert_post(). Please
     666            try again then report this issue to WebTechGlobal. Please note that wp_insert_post() is also used to
     667            create pages in WP.", 'wtgportalmanager' ),
     668                'success',
     669                'Small',
     670                __( 'WP Function Failed', 'wtgportalmanager' )
     671            ); 
     672            return false;       
     673        }           
     674         
     675        // Join Page To Portal
     676        $this->WTGPORTALMANAGER->create_page_relationship( $project_id, $post_id );
     677       
     678        // Pages Purpose (Format) Meta
     679        $this->DB->update_page_purpose( $project_id, $post_id, $_POST['pagepurpose'] );
     680       
     681        // Final Output - Create link to the new page in admin.
     682        $link = get_edit_post_link( $post_id );
     683        $link = "<a href='$link' title='Edit post' target='_blank'>clicking here</a>";
     684        $message = sprintf( __( "A new page has been added to your current active portal. You can
     685        now edit your post by %s", 'wtgportalmanager' ), $link );
     686        $this->UI->create_notice( $message,
     687            'success',
     688            'Small',
     689            __( 'Page Relationship Created', 'wtgportalmanager' )
     690        );                                                       
     691    }
     692   
     693    /**
     694    * Create relationship between current portal and page (not post)
     695    *
     696    * @author Ryan R. Bayne
     697    * @package WTG Portal Manager
     698    * @since 0.0.1
     699    * @version 1.0
     700    */
     701    public function addpagerelationship() {
     702        $project_id = $this->DB->get_active_project_id();
     703        $this->WTGPORTALMANAGER->create_page_relationship( $project_id, $_POST['addpageid'] );
     704        $this->DB->update_page_purpose( $project_id, $_POST['addpageid'], $_POST['pagepurpose'] );
     705        $this->UI->create_notice(
     706            __( "Your page has been added to your current active portal.", 'wtgportalmanager' ),
     707            'success',
     708            'Small',
     709            __( 'Page Relationship Created', 'wtgportalmanager' )
     710        );                                                       
     711    }
     712
     713    /**
     714    * Handle requests made using the form that lists all
     715    * related pages i.e. delete the relationship.
     716    *
     717    * @author Ryan R. Bayne
     718    * @package WTG Portal Manager
     719    * @since 0.0.1
     720    * @version 1.0
     721    */
     722    public function listrelatedpages() {
     723   
     724    }
     725
     726    /**
     727    * Sets the current portals main category.
     728    *
     729    * @author Ryan R. Bayne
     730    * @package WTG Portal Manager
     731    * @since 0.0.1
     732    * @version 1.0
     733    */
     734    public function maincategory() {
     735        $this->WTGPORTALMANAGER->update_main_category( $this->DB->get_active_project_id(), $_POST['selectedcategory'] );
     736        $this->UI->create_notice( __( "The main category allows your portal to have a blog and the selected category will be focused on.", 'wtgportalmanager' ), 'success', 'Small', __( 'Main Category Set', 'wtgportalmanager' ) );
     737    }
     738                                                                                                                                                                                                   
     739    /**
     740    * Handle request to delete the relationship between
     741    * portal and categories.
     742    *
     743    * @author Ryan R. Bayne
     744    * @package WTG Portal Manager
     745    * @since 0.0.1
     746    * @version 1.0
     747    */
     748    public function portalcategories() {
     749
     750    }
     751
     752    /**
     753    * Create relationship between category and portal.
     754    *
     755    * @author Ryan R. Bayne
     756    * @package WTG Portal Manager
     757    * @since 0.0.1
     758    * @version 1.0
     759    */
     760    public function addcategories() {
     761        $this->WTGPORTALMANAGER->add_portal_subcategory( $this->DB->get_active_project_id(), $_POST['selectedsubcategory'] );
     762        $this->UI->create_notice( __( "The new category is now available within your portal.", 'wtgportalmanager' ), 'success', 'Small', __( 'Category Added', 'wtgportalmanager' ) );
     763    }
     764
     765    /**
     766    * Create relationship between users WP menu and portal.
     767    *
     768    * @author Ryan R. Bayne
     769    * @package WTG Portal Manager
     770    * @since 0.0.1
     771    * @version 1.0
     772    */
     773    public function addmenu() {
     774        //     'selectedmenu' => string '2' (length=1)
     775        // 'ismainmenu0' => string 'ismain' (length=6)
     776    }
     777
     778    /**
     779    * Handles request to delete relationship between menu and portal.
     780    *
     781    * @author Ryan R. Bayne
     782    * @package WTG Portal Manager
     783    * @since 0.0.1
     784    * @version 1.0
     785    */
     786    public function menulist() {
     787
     788    }
     789   
     790    /**
     791    * Adds a sidebar to this plugins options. This plugin
     792    * needs to register the sidebar for use by dynamic_sidebars()
     793    * which must be in theme sidebar.php
     794    *
     795    * @author Ryan R. Bayne
     796    * @package WTG Portal Manager
     797    * @since 0.0.1
     798    * @version 1.0
     799    */
     800    public function createsidebar() {
     801       
     802        // Install sidebars option. This can be removed after March 2016.
     803        if( !is_array( get_option( 'wtgportalmanager_sidebars' ) ) ) {
     804            add_option( 'wtgportalmanager_sidebars', array(), false );   
     805        }   
     806                         
     807        $this->WTGPORTALMANAGER->insert_sidebar( $_POST['newsidebarname'] );
     808           
     809        $this->UI->create_notice(
     810            __( "A new sidebar has been stored in this plugins
     811            options (WP currently offers no alternative solution). As a result the new
     812            sidebar will only be available while this plugin is active.", 'wtgportalmanager' ),
     813            'success',
     814            'Small',
     815            __( 'Sidebar Registered', 'wtgportalmanager' )
     816        );
     817    }
     818   
     819    /**
     820    * Save the main sidebar ID.
     821    *
     822    * @author Ryan R. Bayne
     823    * @package WTG Portal Manager
     824    * @since 0.0.1
     825    * @version 1.0
     826    */
     827    public function setsidebars() {
     828        // get the integration data I have setup in array - it is a long term array for all my plugins
     829        $themes_integration_array = $this->WTGPORTALMANAGER->get_themes_integration_info();
     830             
     831        // loop current themes sidebars
     832        foreach( $themes_integration_array['sidebars'] as $themes_dynamic_sidebars )
     833        {                           
     834
     835            // forms menu names and ID equal the post meta_key used to store sidebar ID's
     836            $selected_sidebar_id = $_POST[ $themes_dynamic_sidebars['metakey'] ];
     837           
     838            // set new portal -> sidebar relationship which adds post meta_key used in sidebar.php to the portal meta_key
     839            $this->WTGPORTALMANAGER->set_sidebar_relationship( $this->DB->get_active_project_id(), $themes_dynamic_sidebars['metakey'], $selected_sidebar_id );   
     840           
     841            // add post meta to all posts that do not have it but do have a relationship with the current portal
     842            // get post ID's by querying post, page, maincategory, subcategory meta_keys in portal table
     843               
     844        }       
     845   
     846        $this->UI->create_notice( __( "Your current portals sidebars have been set. This change is applied instantly. Please view your portal as a none registered viewer to test.", 'wtgportalmanager' ), 'success', 'Small', __( 'Main Sidebar Set', 'wtgportalmanager' ) );       
     847    }
     848   
     849    /**
     850    * Activates or disables API's
     851    *
     852    * @author Ryan R. Bayne
     853    * @package WTG Portal Manager
     854    * @since 0.0.1
     855    * @version 1.0
     856    */
     857    public function setupdefaulttwitter() {
     858        global $wtgportalmanager_settings;
     859         
     860        $wtgportalmanager_settings['api']['twitter']['active'] = $_POST['twitterapiswitch'];
     861        //$wtgportalmanager_settings['api']['twitter']['apps']['default'] = $_POST['cache_expire'];
     862       
     863        $wtgportalmanager_settings['api']['twitter']['apps']['default']['consumer_key'] = $_POST['consumer_key'];
     864        $wtgportalmanager_settings['api']['twitter']['apps']['default']['consumer_secret'] = $_POST['consumer_secret'];
     865        $wtgportalmanager_settings['api']['twitter']['apps']['default']['access_token'] = $_POST['access_token'];
     866        $wtgportalmanager_settings['api']['twitter']['apps']['default']['token_secret'] = $_POST['access_token_secret']; 
     867        $wtgportalmanager_settings['api']['twitter']['apps']['default']['screenname'] = $_POST['screenname'];
     868                                       
     869        $this->WTGPORTALMANAGER->update_settings( $wtgportalmanager_settings );   
     870        $this->UI->create_notice( __( "Please check features related to the API
     871        you disabled or activated and ensure they are working as normal.", 'wtgportalmanager' ),
     872        'success', 'Small', __( 'API Updated', 'wtgportalmanager' ) );       
     873    }
     874   
     875    /**
     876    * Store Twitter API settings for the current portal only.
     877    *
     878    * @author Ryan R. Bayne
     879    * @package WTG Portal Manager
     880    * @since 0.0.1
     881    * @version 1.1
     882    *
     883    * @todo do these values require encryption?
     884    */
     885    public function setupportaltwitter() {
     886        global $wtgportalmanager_settings;
     887       
     888        // Allow use of the Twitter API globally.
     889        $wtgportalmanager_settings['api']['twitter']['active'] = true;
     890        $this->WTGPORTALMANAGER->update_settings( $wtgportalmanager_settings );
     891       
     892        // Store Twitter API credentials for the current portal.
     893        $this->WTGPORTALMANAGER->update_portals_twitter_api(
     894            WTGPORTALMANAGER_PROJECT_ID,
     895            $_POST['consumer_key'],
     896            $_POST['consumer_secret'],
     897            $_POST['access_token'],
     898            $_POST['access_token_secret'],
     899            $_POST['screenname']
     900        );   
     901         
     902        $this->UI->create_notice( __( "You have updated the current portals
     903        Twitter App credentials.", 'wtgportalmanager' ),
     904        'success', 'Small', __( 'Portals Twitter Updated', 'wtgportalmanager' ) );       
     905    }
     906   
     907    /**
     908    * Saves global forum configuration.
     909    *
     910    * @author Ryan R. Bayne
     911    * @package WTG Portal Manager
     912    * @since 0.0.1
     913    * @version 1.0
     914    */
     915    public function configureforum() {
     916        global $wtgportalmanager_settings;
     917       
     918        // sanitize path
     919        $forum_path_modified = sanitize_text_field( $_POST['forumpath'] );
     920        $forum_path_modified = stripslashes_deep( $forum_path_modified );       
     921        $forum_path_modified = trailingslashit( $forum_path_modified );
     922       
     923        // now determine if phpBB actually exists
     924        $does_phpbb_exist = $this->PHPBB->phpbb_exists( $forum_path_modified );
     925        if( !$does_phpbb_exist ) {
     926            $this->UI->create_notice( __( "Your forum installation could not be located on the path you gave. Please ensure your forum is supported and remember to visit the forum for advice.", 'wtgportalmanager' ), 'success', 'Small', __( 'Forum Not Found', 'wtgportalmanager' ) );       
     927            return;   
     928        }
     929       
     930        // include the phpBB config file - we need database prefix for queries
     931        require( $forum_path_modified . 'config.php' );
     932       
     933        // add config to settings
     934        $wtgportalmanager_settings['forumconfig']['path'] = $forum_path_modified;
     935        $wtgportalmanager_settings['forumconfig']['status'] = $_POST['globalforumswitch'];
     936        $wtgportalmanager_settings['forumconfig']['tableprefix'] = $table_prefix;
     937        $wtgportalmanager_settings['forumconfig']['admrelativepath'] = $phpbb_adm_relative_path;
     938        $wtgportalmanager_settings['forumconfig']['phpbbversion'] =  $this->PHPBB->version();
     939         
     940        // ensure compatible phpBB version installed
     941        if( $wtgportalmanager_settings['forumconfig']['phpbbversion'] < '3.1' ) {
     942            $this->UI->create_notice( __( "This plugin does not support your current phpBB version which is " . $wtgportalmanager_settings['forumconfig']['phpbbversion'], 'wtgportalmanager' ), 'success', 'Small', __( 'Forum Version Not Supported', 'wtgportalmanager' ) );
     943            return;
     944        }
     945       
     946        $this->WTGPORTALMANAGER->update_settings( $wtgportalmanager_settings );
     947       
     948        $this->UI->create_notice( __( "You have saved your forums configuration and can now begin displaying forum data in your portals.", 'wtgportalmanager' ), 'success', 'Small', __( 'Forum Configuration Saved', 'wtgportalmanager' ) );       
     949    }
     950   
     951    /**
     952    * Handle request to save the main forum settings for the current portal.
     953    *
     954    * @author Ryan R. Bayne
     955    * @package WTG Portal Manager
     956    * @since 0.0.1
     957    * @version 1.0
     958    */
     959    public function setupportalforum() {
     960        $got_forum_row = $this->PHPBB->get_forum( $_POST['mainforumid'] );
     961       
     962        // ensure forum ID is valid (numeric validation already done before arriving here using my own security approach)
     963        if( !$got_forum_row || empty( $got_forum_row ) ) {
     964            $this->UI->create_notice( __( "The forum ID you entered does not match any forums in your phpBB database. Nothing was saved, please try again.", 'wtgportalmanager' ), 'error', 'Small', __( 'Forum Not Found', 'wtgportalmanager' ) );                           
     965            return;   
     966        }
     967       
     968        $this->WTGPORTALMANAGER->update_portals_forumsettings( WTGPORTALMANAGER_PROJECT_ID, $_POST['portalforumswitch'], $_POST['mainforumid'] );
     969        $this->UI->create_notice( __( "You have saved your portals forum settings. If you set the switch to enabled then the next step is to ensure your portal is displaying information using forum data.", 'wtgportalmanager' ), 'success', 'Small', __( 'Forum Settings Saved', 'wtgportalmanager' ) );                       
     970    }
     971   
     972    /**
     973    * Handles request from form for selecting portals sources of information
     974    * for display on the Updates page.
     975    *
     976    * @author Ryan R. Bayne
     977    * @package WTG Portal Manager
     978    * @since 0.0.1
     979    * @version 1.2
     980    */
     981    public function selectupdatesources() {       
     982        $this->DB->update_project_meta( WTGPORTALMANAGER_PROJECT_ID, 'updatepagesources', $_POST['informationsources'] );
     983        $this->UI->create_notice( __( "Sources of information for your Updates page were saved. You should check your current portals Updates page and ensure it is displaying what you expect.", 'wtgportalmanager' ), 'success', 'Small', __( 'Update Sources Saved', 'wtgportalmanager' ) );                               
     984    }
     985   
     986    /**
     987    * Handles request of selecting portals sources of information
     988    * for display on the Activity page.
     989    *
     990    * @author Ryan R. Bayne
     991    * @package WTG Portal Manager
     992    * @since 0.0.1
     993    * @version 1.2
     994    */
     995    public function selectactivitysources() {       
     996        $this->DB->update_project_meta( WTGPORTALMANAGER_PROJECT_ID, 'activitypagesources', $_POST['informationsources'] );
     997        $this->UI->create_notice(
     998            __( "Sources of information for your Activity page were saved. You should
     999            check your current portals Updates page and ensure it is displaying what you expect.", 'wtgportalmanager' ),
     1000            'success',
     1001            'Small',
     1002            __( 'Activity Sources Saved', 'wtgportalmanager' )
     1003        );                               
     1004    }
     1005
     1006    /**
     1007    * Debug mode switch.
     1008    *
     1009    * @author Ryan R. Bayne
     1010    * @package WebTechGlobal WordPress Plugins
     1011    * @version 1.0
     1012    */
     1013    public function debugmodeswitch() {
     1014        $debug_status = get_option( 'webtechglobal_displayerrors' );
     1015        if($debug_status){     
     1016            update_option( 'webtechglobal_displayerrors',false );
     1017            $new = 'disabled';
     1018           
     1019            $this->UI->create_notice( __( "Error display mode has been $new." ), 'success', 'Tiny',
     1020            __( 'Debug Mode Switch', 'wtgportalmanager' ) );               
     1021                       
     1022            wp_redirect( get_bloginfo( 'url' ) . '/wp-admin/admin.php?page=' . $_GET['page'] );
     1023            exit;
     1024        } else {
     1025            update_option( 'webtechglobal_displayerrors',true );
     1026            $new = 'enabled';
     1027           
     1028            $this->UI->create_notice( __( "Error display mode has been $new." ), 'success', 'Tiny',
     1029            __( 'Debug Mode Switch', 'wtgportalmanager' ) );               
     1030           
     1031            wp_redirect( get_bloginfo( 'url' ) . '/wp-admin/admin.php?page=' . $_GET['page'] );
     1032            exit;
     1033        }
     1034    }
     1035   
     1036    /**
     1037    * Destroy the relationship between a page and project. 
     1038    *
     1039    * @author Ryan R. Bayne
     1040    * @package WebTechGlobal WordPress Plugins
     1041    * @since 0.1.1
     1042    * @version 1.0
     1043    */
     1044    public function removeprojectpage() {
     1045        global $wpdb;
     1046       
     1047        if( !isset( $_GET['removedid']) ) {
     1048            $this->UI->create_notice( __( "No valid page ID in the URL." ), 'error', 'Tiny',
     1049            __( 'Portal Not Changed', 'wtgportalmanager' ) );         
     1050            return;
     1051        }
     1052       
     1053        if( !is_numeric( $_GET['removedid'] ) ) {
     1054            $this->UI->create_notice( __( "Invalid page ID in the URL, please ry again." ), 'error', 'Tiny',
     1055            __( 'No Changes To Portal', 'wtgportalmanager' ) );           
     1056            return;
     1057        }
     1058       
     1059        $this->DB->undo_project_page( WTGPORTALMANAGER_PROJECT_ID, $_GET['removedid'] );
     1060       
     1061            $this->UI->create_notice( __( "Page removed from portal. It will no longer be displayed in the portals
     1062            meny or in the porals admin option." ), 'success', 'Tiny',
     1063            __( 'Portal Changed', 'wtgportalmanager' ) );                   
     1064    }
     1065
     1066    /**
     1067    * Developer tools options form submission.
     1068    *
     1069    * @author Ryan R. Bayne
     1070    * @package WebTechGlobal WordPress Plugins
     1071    * @since 0.0.11
     1072    * @version 1.2
     1073    */
     1074    public function developertoolssetup() {
     1075        global $wp_roles;
     1076
     1077        // Does developer role exist?
     1078        $developer_role_status = false;
     1079        foreach( $wp_roles->roles as $role_name => $role_array ) {
     1080            if( $role_name == 'developer' ) {
     1081                $developer_role_status = true;   
     1082            }           
     1083        }
     1084               
     1085        // Do we need to install developer role?
     1086        $developer_role_result = null;
     1087        if( !$developer_role_status ) {
     1088           
     1089            // Collect capabilities from $_POST for developer role.
     1090            $added_caps = array();
     1091            foreach( $_POST['addrolecapabilities'] as $numeric_key => $role_name ) {
     1092                $added_caps[ $role_name ] = true;
     1093            }
     1094           
     1095            // Add the developer role.       
     1096            $developer_role_result = add_role(
     1097                'developer',
     1098                'Developer',
     1099                $added_caps
     1100            );
     1101        }
     1102
     1103        if ( null !== $developer_role_result ) {
     1104           
     1105            $description = __( "Multitool installed the Developer Role
     1106            to your blog. The role and its abilities will apply to all
     1107            WebTechGlobal plugins you have installed.", 'wtgportalmanager' );
     1108            $title = __( 'Developer Role Installed', 'wtgportalmanager' );   
     1109            $this->UI->create_notice(
     1110                $description,
     1111                'success',
     1112                'Small',
     1113                $title
     1114            );
     1115           
     1116        } else {
     1117           
     1118            $description = __( "The developer role appears to have
     1119            been installed already. No changes to your roles were made.", 'wtgportalmanager' );
     1120            $title = __( 'No Role Changes', 'wtgportalmanager' );   
     1121            $this->UI->create_notice(
     1122                $description,
     1123                'info',
     1124                'Small',
     1125                $title
     1126            );
     1127           
     1128        }           
     1129    }         
     1130   
     1131    /**
     1132    * Create a page for the current portal.
     1133    *
     1134    * @author Ryan R. Bayne
     1135    * @package WebTechGlobal WordPress Plugins
     1136    * @version 1.0
     1137    *
     1138    * @todo use array of formats and custom formats to valid the $_GET['format'] value.
     1139    */
     1140    public function quickcreateportalpage() {
     1141        $project_id = $this->DB->get_active_project_id();
     1142       
     1143        // Convert users page purpose selection to readable format.
     1144        $readable_purpose = '';
     1145        foreach( $this->CONFIG->postformats() as $format => $meta ) {
     1146           
     1147            if( $format == $_GET['format'] ) {
    6401148                $readable_purpose = $meta['title']; 
    6411149            }
     
    6651173       
    6661174        // Pages Purpose (Format) Meta
    667         $this->DB->update_page_purpose( $project_id, $post_id, $_POST['pagepurpose'] );
    668        
    669         // Final Output
    670         $this->UI->create_notice( __( "A new page has been added to your current
    671             active portal.", 'wtgportalmanager' ),
    672             'success',
    673             'Small',
    674             __( 'Page Relationship Created', 'wtgportalmanager' )
    675         );                                                       
    676     }
    677    
    678     /**
    679     * Create relationship between current portal and page (not post)
    680     *
    681     * @author Ryan R. Bayne
    682     * @package WTG Portal Manager
    683     * @since 0.0.1
    684     * @version 1.0
    685     */
    686     public function addpagerelationship() {
    687         $project_id = $this->DB->get_active_project_id();
    688         $this->WTGPORTALMANAGER->create_page_relationship( $project_id, $_POST['addpageid'] );
    689         $this->DB->update_page_purpose( $project_id, $_POST['addpageid'], $_POST['pagepurpose'] );
    690         $this->UI->create_notice( __( "A new page has been added to your current active portal.", 'wtgportalmanager' ), 'success', 'Small', __( 'Page Relationship Created', 'wtgportalmanager' ) );                                                       
    691     }
    692 
    693     /**
    694     * Handle requests made using the form that lists all
    695     * related pages i.e. delete the relationship.
    696     *
    697     * @author Ryan R. Bayne
    698     * @package WTG Portal Manager
    699     * @since 0.0.1
    700     * @version 1.0
    701     */
    702     public function listrelatedpages() {
    703    
    704     }
    705 
    706     /**
    707     * Sets the current portals main category.
    708     *
    709     * @author Ryan R. Bayne
    710     * @package WTG Portal Manager
    711     * @since 0.0.1
    712     * @version 1.0
    713     */
    714     public function maincategory() {
    715         $this->WTGPORTALMANAGER->update_main_category( $this->DB->get_active_project_id(), $_POST['selectedcategory'] );
    716         $this->UI->create_notice( __( "The main category allows your portal to have a blog and the selected category will be focused on.", 'wtgportalmanager' ), 'success', 'Small', __( 'Main Category Set', 'wtgportalmanager' ) );
    717     }
    718                                                                                                                                                                                                    
    719     /**
    720     * Handle request to delete the relationship between
    721     * portal and categories.
    722     *
    723     * @author Ryan R. Bayne
    724     * @package WTG Portal Manager
    725     * @since 0.0.1
    726     * @version 1.0
    727     */
    728     public function portalcategories() {
    729 
    730     }
    731 
    732     /**
    733     * Create relationship between category and portal.
    734     *
    735     * @author Ryan R. Bayne
    736     * @package WTG Portal Manager
    737     * @since 0.0.1
    738     * @version 1.0
    739     */
    740     public function addcategories() {
    741         $this->WTGPORTALMANAGER->add_portal_subcategory( $this->DB->get_active_project_id(), $_POST['selectedsubcategory'] );
    742         $this->UI->create_notice( __( "The new category is now available within your portal.", 'wtgportalmanager' ), 'success', 'Small', __( 'Category Added', 'wtgportalmanager' ) );
    743     }
    744 
    745     /**
    746     * Create relationship between users WP menu and portal.
    747     *
    748     * @author Ryan R. Bayne
    749     * @package WTG Portal Manager
    750     * @since 0.0.1
    751     * @version 1.0
    752     */
    753     public function addmenu() {
    754         //     'selectedmenu' => string '2' (length=1)
    755         // 'ismainmenu0' => string 'ismain' (length=6)
    756     }
    757 
    758     /**
    759     * Handles request to delete relationship between menu and portal.
    760     *
    761     * @author Ryan R. Bayne
    762     * @package WTG Portal Manager
    763     * @since 0.0.1
    764     * @version 1.0
    765     */
    766     public function menulist() {
    767 
    768     }
    769    
    770     /**
    771     * Adds a sidebar to this plugins options. This plugin
    772     * needs to register the sidebar for use by dynamic_sidebars()
    773     * which must be in theme sidebar.php
    774     *
    775     * @author Ryan R. Bayne
    776     * @package WTG Portal Manager
    777     * @since 0.0.1
    778     * @version 1.0
    779     */
    780     public function createsidebar() {
    781        
    782         // Install sidebars option. This can be removed after March 2016.
    783         if( !is_array( get_option( 'wtgportalmanager_sidebars' ) ) ) {
    784             add_option( 'wtgportalmanager_sidebars', array(), false );   
    785         }   
    786                          
    787         $this->WTGPORTALMANAGER->insert_sidebar( $_POST['newsidebarname'] );
    788            
    789         $this->UI->create_notice(
    790             __( "A new sidebar has been stored in this plugins
    791             options (WP currently offers no alternative solution). As a result the new
    792             sidebar will only be available while this plugin is active.", 'wtgportalmanager' ),
    793             'success',
    794             'Small',
    795             __( 'Sidebar Registered', 'wtgportalmanager' )
    796         );
    797     }
    798    
    799     /**
    800     * Save the main sidebar ID.
    801     *
    802     * @author Ryan R. Bayne
    803     * @package WTG Portal Manager
    804     * @since 0.0.1
    805     * @version 1.0
    806     */
    807     public function setsidebars() {
    808         // get the integration data I have setup in array - it is a long term array for all my plugins
    809         $themes_integration_array = $this->WTGPORTALMANAGER->get_themes_integration_info();
    810              
    811         // loop current themes sidebars
    812         foreach( $themes_integration_array['sidebars'] as $themes_dynamic_sidebars )
    813         {                           
    814 
    815             // forms menu names and ID equal the post meta_key used to store sidebar ID's
    816             $selected_sidebar_id = $_POST[ $themes_dynamic_sidebars['metakey'] ];
    817            
    818             // set new portal -> sidebar relationship which adds post meta_key used in sidebar.php to the portal meta_key
    819             $this->WTGPORTALMANAGER->set_sidebar_relationship( $this->DB->get_active_project_id(), $themes_dynamic_sidebars['metakey'], $selected_sidebar_id );   
    820            
    821             // add post meta to all posts that do not have it but do have a relationship with the current portal
    822             // get post ID's by querying post, page, maincategory, subcategory meta_keys in portal table
    823                
    824         }       
    825    
    826         $this->UI->create_notice( __( "Your current portals sidebars have been set. This change is applied instantly. Please view your portal as a none registered viewer to test.", 'wtgportalmanager' ), 'success', 'Small', __( 'Main Sidebar Set', 'wtgportalmanager' ) );       
    827     }
    828    
    829     /**
    830     * Activates or disables API's
    831     *
    832     * @author Ryan R. Bayne
    833     * @package WTG Portal Manager
    834     * @since 0.0.1
    835     * @version 1.0
    836     */
    837     public function setupdefaulttwitter() {
    838         global $wtgportalmanager_settings;
    839          
    840         $wtgportalmanager_settings['api']['twitter']['active'] = $_POST['twitterapiswitch'];
    841         //$wtgportalmanager_settings['api']['twitter']['apps']['default'] = $_POST['cache_expire'];
    842        
    843         $wtgportalmanager_settings['api']['twitter']['apps']['default']['consumer_key'] = $_POST['consumer_key'];
    844         $wtgportalmanager_settings['api']['twitter']['apps']['default']['consumer_secret'] = $_POST['consumer_secret'];
    845         $wtgportalmanager_settings['api']['twitter']['apps']['default']['access_token'] = $_POST['access_token'];
    846         $wtgportalmanager_settings['api']['twitter']['apps']['default']['token_secret'] = $_POST['access_token_secret']; 
    847         $wtgportalmanager_settings['api']['twitter']['apps']['default']['screenname'] = $_POST['screenname'];
    848                                        
    849         $this->WTGPORTALMANAGER->update_settings( $wtgportalmanager_settings );   
    850         $this->UI->create_notice( __( "Please check features related to the API
    851         you disabled or activated and ensure they are working as normal.", 'wtgportalmanager' ),
    852         'success', 'Small', __( 'API Updated', 'wtgportalmanager' ) );       
    853     }
    854    
    855     /**
    856     * Store Twitter API settings for the current portal only.
    857     *
    858     * @author Ryan R. Bayne
    859     * @package WTG Portal Manager
    860     * @since 0.0.1
    861     * @version 1.1
    862     *
    863     * @todo do these values require encryption?
    864     */
    865     public function setupportaltwitter() {
    866         global $wtgportalmanager_settings;
    867        
    868         // Allow use of the Twitter API globally.
    869         $wtgportalmanager_settings['api']['twitter']['active'] = true;
    870         $this->WTGPORTALMANAGER->update_settings( $wtgportalmanager_settings );
    871        
    872         // Store Twitter API credentials for the current portal.
    873         $this->WTGPORTALMANAGER->update_portals_twitter_api(
    874             WTGPORTALMANAGER_PROJECT_ID,
    875             $_POST['consumer_key'],
    876             $_POST['consumer_secret'],
    877             $_POST['access_token'],
    878             $_POST['access_token_secret'],
    879             $_POST['screenname']
    880         );   
    881          
    882         $this->UI->create_notice( __( "You have updated the current portals
    883         Twitter App credentials.", 'wtgportalmanager' ),
    884         'success', 'Small', __( 'Portals Twitter Updated', 'wtgportalmanager' ) );       
    885     }
    886    
    887     /**
    888     * Saves global forum configuration.
    889     *
    890     * @author Ryan R. Bayne
    891     * @package WTG Portal Manager
    892     * @since 0.0.1
    893     * @version 1.0
    894     */
    895     public function configureforum() {
    896         global $wtgportalmanager_settings;
    897        
    898         // sanitize path
    899         $forum_path_modified = sanitize_text_field( $_POST['forumpath'] );
    900         $forum_path_modified = stripslashes_deep( $forum_path_modified );       
    901         $forum_path_modified = trailingslashit( $forum_path_modified );
    902        
    903         // now determine if phpBB actually exists
    904         $does_phpbb_exist = $this->PHPBB->phpbb_exists( $forum_path_modified );
    905         if( !$does_phpbb_exist ) {
    906             $this->UI->create_notice( __( "Your forum installation could not be located on the path you gave. Please ensure your forum is supported and remember to visit the forum for advice.", 'wtgportalmanager' ), 'success', 'Small', __( 'Forum Not Found', 'wtgportalmanager' ) );       
    907             return;   
    908         }
    909        
    910         // include the phpBB config file - we need database prefix for queries
    911         require( $forum_path_modified . 'config.php' );
    912        
    913         // add config to settings
    914         $wtgportalmanager_settings['forumconfig']['path'] = $forum_path_modified;
    915         $wtgportalmanager_settings['forumconfig']['status'] = $_POST['globalforumswitch'];
    916         $wtgportalmanager_settings['forumconfig']['tableprefix'] = $table_prefix;
    917         $wtgportalmanager_settings['forumconfig']['admrelativepath'] = $phpbb_adm_relative_path;
    918         $wtgportalmanager_settings['forumconfig']['phpbbversion'] =  $this->PHPBB->version();
    919          
    920         // ensure compatible phpBB version installed
    921         if( $wtgportalmanager_settings['forumconfig']['phpbbversion'] < '3.1' ) {
    922             $this->UI->create_notice( __( "This plugin does not support your current phpBB version which is " . $wtgportalmanager_settings['forumconfig']['phpbbversion'], 'wtgportalmanager' ), 'success', 'Small', __( 'Forum Version Not Supported', 'wtgportalmanager' ) );
    923             return;
    924         }
    925        
    926         $this->WTGPORTALMANAGER->update_settings( $wtgportalmanager_settings );
    927        
    928         $this->UI->create_notice( __( "You have saved your forums configuration and can now begin displaying forum data in your portals.", 'wtgportalmanager' ), 'success', 'Small', __( 'Forum Configuration Saved', 'wtgportalmanager' ) );       
    929     }
    930    
    931     /**
    932     * Handle request to save the main forum settings for the current portal.
    933     *
    934     * @author Ryan R. Bayne
    935     * @package WTG Portal Manager
    936     * @since 0.0.1
    937     * @version 1.0
    938     */
    939     public function setupportalforum() {
    940         $got_forum_row = $this->PHPBB->get_forum( $_POST['mainforumid'] );
    941        
    942         // ensure forum ID is valid (numeric validation already done before arriving here using my own security approach)
    943         if( !$got_forum_row || empty( $got_forum_row ) ) {
    944             $this->UI->create_notice( __( "The forum ID you entered does not match any forums in your phpBB database. Nothing was saved, please try again.", 'wtgportalmanager' ), 'error', 'Small', __( 'Forum Not Found', 'wtgportalmanager' ) );                           
    945             return;   
    946         }
    947        
    948         $this->WTGPORTALMANAGER->update_portals_forumsettings( WTGPORTALMANAGER_PROJECT_ID, $_POST['portalforumswitch'], $_POST['mainforumid'] );
    949         $this->UI->create_notice( __( "You have saved your portals forum settings. If you set the switch to enabled then the next step is to ensure your portal is displaying information using forum data.", 'wtgportalmanager' ), 'success', 'Small', __( 'Forum Settings Saved', 'wtgportalmanager' ) );                       
    950     }
    951    
    952     /**
    953     * Handles request from form for selecting portals sources of information
    954     * for display on the Updates page.
    955     *
    956     * @author Ryan R. Bayne
    957     * @package WTG Portal Manager
    958     * @since 0.0.1
    959     * @version 1.2
    960     */
    961     public function selectupdatesources() {       
    962         $this->DB->update_project_meta( WTGPORTALMANAGER_PROJECT_ID, 'updatepagesources', $_POST['informationsources'] );
    963         $this->UI->create_notice( __( "Sources of information for your Updates page were saved. You should check your current portals Updates page and ensure it is displaying what you expect.", 'wtgportalmanager' ), 'success', 'Small', __( 'Update Sources Saved', 'wtgportalmanager' ) );                               
    964     }
    965    
    966     /**
    967     * Handles request of selecting portals sources of information
    968     * for display on the Activity page.
    969     *
    970     * @author Ryan R. Bayne
    971     * @package WTG Portal Manager
    972     * @since 0.0.1
    973     * @version 1.2
    974     */
    975     public function selectactivitysources() {       
    976         $this->DB->update_project_meta( WTGPORTALMANAGER_PROJECT_ID, 'activitypagesources', $_POST['informationsources'] );
    977         $this->UI->create_notice(
    978             __( "Sources of information for your Activity page were saved. You should
    979             check your current portals Updates page and ensure it is displaying what you expect.", 'wtgportalmanager' ),
    980             'success',
    981             'Small',
    982             __( 'Activity Sources Saved', 'wtgportalmanager' )
    983         );                               
    984     }
    985 
    986     /**
    987     * Debug mode switch.
    988     *
    989     * @author Ryan R. Bayne
    990     * @package WebTechGlobal WordPress Plugins
    991     * @version 1.0
    992     */
    993     public function debugmodeswitch() {
    994         $debug_status = get_option( 'webtechglobal_displayerrors' );
    995         if($debug_status){     
    996             update_option( 'webtechglobal_displayerrors',false );
    997             $new = 'disabled';
    998            
    999             $this->UI->create_notice( __( "Error display mode has been $new." ), 'success', 'Tiny',
    1000             __( 'Debug Mode Switch', 'wtgportalmanager' ) );               
    1001                        
    1002             wp_redirect( get_bloginfo( 'url' ) . '/wp-admin/admin.php?page=' . $_GET['page'] );
    1003             exit;
    1004         } else {
    1005             update_option( 'webtechglobal_displayerrors',true );
    1006             $new = 'enabled';
    1007            
    1008             $this->UI->create_notice( __( "Error display mode has been $new." ), 'success', 'Tiny',
    1009             __( 'Debug Mode Switch', 'wtgportalmanager' ) );               
    1010            
    1011             wp_redirect( get_bloginfo( 'url' ) . '/wp-admin/admin.php?page=' . $_GET['page'] );
    1012             exit;
    1013         }
    1014     }
    1015    
    1016     /**
    1017     * Destroy the relationship between a page and project. 
    1018     *
    1019     * @author Ryan R. Bayne
    1020     * @package WebTechGlobal WordPress Plugins
    1021     * @since 0.1.1
    1022     * @version 1.0
    1023     */
    1024     public function removeprojectpage() {
    1025         global $wpdb;
    1026        
    1027         if( !isset( $_GET['removedid']) ) {
    1028             $this->UI->create_notice( __( "No valid page ID in the URL." ), 'error', 'Tiny',
    1029             __( 'Portal Not Changed', 'wtgportalmanager' ) );         
    1030             return;
    1031         }
    1032        
    1033         if( !is_numeric( $_GET['removedid'] ) ) {
    1034             $this->UI->create_notice( __( "Invalid page ID in the URL, please ry again." ), 'error', 'Tiny',
    1035             __( 'No Changes To Portal', 'wtgportalmanager' ) );           
    1036             return;
    1037         }
    1038        
    1039         $this->DB->undo_project_page( WTGPORTALMANAGER_PROJECT_ID, $_GET['removedid'] );
    1040        
    1041             $this->UI->create_notice( __( "Page removed from portal. It will no longer be displayed in the portals
    1042             meny or in the porals admin option." ), 'success', 'Tiny',
    1043             __( 'Portal Changed', 'wtgportalmanager' ) );                   
    1044     }
    1045 
    1046     /**
    1047     * Developer tools options form submission.
    1048     *
    1049     * @author Ryan R. Bayne
    1050     * @package WebTechGlobal WordPress Plugins
    1051     * @since 0.0.11
    1052     * @version 1.2
    1053     */
    1054     public function developertoolssetup() {
    1055         global $wp_roles;
    1056 
    1057         // Does developer role exist?
    1058         $developer_role_status = false;
    1059         foreach( $wp_roles->roles as $role_name => $role_array ) {
    1060             if( $role_name == 'developer' ) {
    1061                 $developer_role_status = true;   
    1062             }           
    1063         }
    1064                
    1065         // Do we need to install developer role?
    1066         $developer_role_result = null;
    1067         if( !$developer_role_status ) {
    1068            
    1069             // Collect capabilities from $_POST for developer role.
    1070             $added_caps = array();
    1071             foreach( $_POST['addrolecapabilities'] as $numeric_key => $role_name ) {
    1072                 $added_caps[ $role_name ] = true;
    1073             }
    1074            
    1075             // Add the developer role.       
    1076             $developer_role_result = add_role(
    1077                 'developer',
    1078                 'Developer',
    1079                 $added_caps
    1080             );
    1081         }
    1082 
    1083         if ( null !== $developer_role_result ) {
    1084            
    1085             $description = __( "Multitool installed the Developer Role
    1086             to your blog. The role and its abilities will apply to all
    1087             WebTechGlobal plugins you have installed.", 'wtgportalmanager' );
    1088             $title = __( 'Developer Role Installed', 'wtgportalmanager' );   
    1089             $this->UI->create_notice(
    1090                 $description,
    1091                 'success',
    1092                 'Small',
    1093                 $title
    1094             );
    1095            
    1096         } else {
    1097            
    1098             $description = __( "The developer role appears to have
    1099             been installed already. No changes to your roles were made.", 'wtgportalmanager' );
    1100             $title = __( 'No Role Changes', 'wtgportalmanager' );   
    1101             $this->UI->create_notice(
    1102                 $description,
    1103                 'info',
    1104                 'Small',
    1105                 $title
    1106             );
    1107            
    1108         }           
    1109     }         
    1110    
    1111     /**
    1112     * Create a page for the current portal.
    1113     *
    1114     * @author Ryan R. Bayne
    1115     * @package WebTechGlobal WordPress Plugins
    1116     * @version 1.0
    1117     *
    1118     * @todo use array of formats and custom formats to valid the $_GET['format'] value.
    1119     */
    1120     public function quickcreateportalpage() {
    1121         $project_id = $this->DB->get_active_project_id();
    1122        
    1123         // Convert users page purpose selection to readable format.
    1124         $readable_purpose = '';
    1125         foreach( $this->CONFIG->postformats() as $format => $meta ) {
    1126            
    1127             if( $format == $_GET['format'] ) {
    1128                 $readable_purpose = $meta['title']; 
    1129             }
    1130  
    1131         }       
    1132    
    1133         // Get current portals name to use as the title.
    1134         $project_name = $this->DB->get_project_name( $project_id );
    1135        
    1136         // Build Page Title
    1137         $title = $project_name . ' ' .  $readable_purpose;
    1138          
    1139         // Create post object.                                     
    1140         $my_post = array(
    1141           'post_title'    => wp_strip_all_tags( $title ),
    1142           'post_content'  => __( 'Under Construction', 'wtgportalmanager' ),
    1143           'post_status'   => 'publish',
    1144           'post_author'   => get_current_user_id(),
    1145           'post_type'     => 'page'
    1146         );
    1147          
    1148         // Insert the post into the database.
    1149         $post_id = wp_insert_post( $my_post );
    1150                      
    1151         // Join Page To Portal
    1152         $this->WTGPORTALMANAGER->create_page_relationship( $project_id, $post_id );
    1153        
    1154         // Pages Purpose (Format) Meta
    11551175        $this->DB->update_page_purpose( $project_id, $post_id, $_GET['format'] );
    11561176       
  • wtg-portal-manager/trunk/classes/class-twitter.php

    r1359302 r1369147  
    7070    * @version 1.0
    7171    *
     72    * @returns boolean false if no defualt credentials stored.
     73    *
    7274    * @todo Change storage of default API credentials to the options table and serialize values.
    7375    */
    7476    public function get_default_credentials() {
    7577        global $wtgportalmanager_settings;
    76         return $wtgportalmanager_settings['api']['twitter']['apps']['default'];                                   
     78        if( isset( $wtgportalmanager_settings['api']['twitter']['apps']['default'] ) ) {
     79            return $wtgportalmanager_settings['api']['twitter']['apps']['default'];
     80        }
     81        return false;                                   
    7782    }
    7883   
  • wtg-portal-manager/trunk/classes/class-wtgportalmanager.php

    r1365903 r1369147  
    177177    * @package WTG Portal Manager
    178178    * @since 0.0.1
    179     * @version 1.2
     179    * @version 1.3
    180180    *
    181181    * @todo create an option for the cache period
     
    185185    */
    186186    public function portal_updates_shortcode( $atts ) {
    187                            
     187                       
    188188        // if we do not have a portal ID - we will assume we are on a view that does not
    189189        // yet support it i.e. category with a list of posts.
     
    202202
    203203        // check for a cached list of items
     204        //delete_transient( 'wtgportalmanager_updatepage' . WTGPORTALMANAGER_PUBLIC_PROJECTID ); var_dump( 'Transient cache deleted during testing on line ' . __LINE__ );
    204205        $cached_query = get_transient( 'wtgportalmanager_updatepage' . WTGPORTALMANAGER_PUBLIC_PROJECTID );
    205206        if( $cached_query !== false ) {   
     
    271272            // Establish a set of Twitter API credentials.
    272273            $portals_api_credentials = self::get_portals_twitter_api( WTGPORTALMANAGER_PUBLIC_PROJECTID );
    273      
     274
    274275            // Establish if any values are going to cause a problem.
    275276            $problem_found = false;
    276277            if( is_array( $portals_api_credentials ) ) {
    277278
     279                // Replace portals configuration with the credentials passed to this method.
     280                if( isset( $atts['usertimeline'] ) && is_string( $atts['usertimeline'] ) ) {
     281                    $portals_api_credentials['screenname'] = $atts['usertimeline'];
     282                }
     283                               
    278284                // usertimeline
    279                 if( !isset( $portals_api_credentials['screenname'] ) || !is_string( $portals_api_credentials['screenname'] ) ) {
     285                if( !$portals_api_credentials['screenname'] || $portals_api_credentials['screenname'] == '' ) {
    280286                    $problem_found = 'screenname';
    281287                }
     
    300306                    $problem_found = 'token_secret';
    301307                }
     308            }
     309            else {
     310                $problem_found = 'The current portal does not have any Twitter credentials.';
    302311            }
    303            
     312
    304313            // If the $api_credentials giving are not valid then use default to help reduce problems.
    305314            if( $problem_found !== false ) {
     
    311320                           
    312321                // Write over defaults with the credentials passed to this method.
    313 
     322                if( isset( $atts['usertimeline'] ) && is_string( $atts['usertimeline'] ) ) {
     323                    $default_api_credentials['screenname'] = $atts['usertimeline'];
     324                }
     325               
    314326                // usertimeline
    315327                if( !$default_api_credentials['screenname'] ) { $invalid_default_credentials = 'screenname'; }
     
    33203332                 break;
    33213333               case 'updates':
    3322                  $default_content = "[portalupdate projectid=$project_id usertimeline=WebTechGlobal]";
     3334                 $default_content = "[portalupdate usertimeline=WebTechGlobal]";
    33233335                 break;
    33243336               case 2:
  • wtg-portal-manager/trunk/readme.txt

    r1365903 r1369147  
    37371. High customization per portal is the goal, more to come soon!
    3838
     39= Work In Progress =
     40* Current Portal Selection menu on main page defaults to the first item.
     41* Too many configuration values are being stored in the settings array. Starting with sidebars move them to individual options.
     42* Serialize API credentials using key stored in plugin.
     43* Need a way to delete values in a form and reset it.
     44* Add functionality to the portal information in head of pages i.e. link to the portal, quick tools.
     45* Allow more than one Twitter account to be used on Updates list.
     46* Default values on Create Portal menus might be the cause of security warnings.
     47* Developer widget - will include portal ID and functionality for quickly changing portal.
     48* Setup a Trello account for this project.
     49
    3950== Installation ==
    4051
     
    89100This method is safer than using any other source for the files.
    90101
    91 == Changelog ==
     102== Changelog ==
     103= 1.0.6  = 
     104* Feature Changes   
     105    * Incorrect text replaced on Create New Portal Page form.
     106    * New page purposes added: information, steps, datatable, index and people.
     107    * Added link to notice for creation of new portal page.
     108* Technical Changes
     109    * A shortcode like [portalupdate timeline="WebTechGlobal"] now works better as the timeline value over-rides all others.
     110 
    92111= 1.0.5 = 
    93112* Feature Changes   
  • wtg-portal-manager/trunk/views/buildpages.php

    r1365903 r1369147  
    133133    * @author Ryan Bayne
    134134    * @package WTG Portal Manager
    135     * @version 1.0
     135    * @version 1.1
    136136    */
    137137    public function postbox_buildpages_createnewportalpage( $data, $box ) {                               
    138  
    139         $this->UI->postbox_content_header( $box['title'], $box['args']['formid'], __( 'Add an existing page to your active portal. A relationship between page and portal will be created - allowing other options for that page.', 'wtgportalmanager' ), false );       
     138        $this->UI->postbox_content_header( $box['title'], $box['args']['formid'],
     139        __( 'Create a new page with a specific purpose for the current portal. It
     140        will be instantly associated with your portal and added to the portals menu.', 'wtgportalmanager' ), false );       
    140141        $this->Forms->form_start( $box['args']['formid'], $box['args']['formid'], $box['title'] );
    141142        ?> 
  • wtg-portal-manager/trunk/wtg-portal-manager.php

    r1365903 r1369147  
    22/*
    33Plugin Name: WTG Portal Manager Beta
    4 Version: 1.0.5
     4Version: 1.0.6
    55Plugin URI: http://www.webtechglobal.co.uk/
    66Description: Every service and product can have a portal on your WordPress site.
     
    4242
    4343// define constants, feel free to add some of your own...                             
    44 if(!defined( "WTGPORTALMANAGER_VERSION") ){define( "WTGPORTALMANAGER_VERSION", '1.0.5' );}
     44if(!defined( "WTGPORTALMANAGER_VERSION") ){define( "WTGPORTALMANAGER_VERSION", '1.0.6' );}
    4545if(!defined( "WTGPORTALMANAGER_NAME") ){define( "WTGPORTALMANAGER_NAME", 'WTG Portal Manager' );}
    4646if(!defined( "WTGPORTALMANAGER__FILE__") ){define( "WTGPORTALMANAGER__FILE__", __FILE__);}
Note: See TracChangeset for help on using the changeset viewer.