Plugin Directory

Changeset 492434


Ignore:
Timestamp:
01/19/2012 11:59:23 PM (14 years ago)
Author:
gliffy
Message:

version 0.2

Location:
gliffy-plugin-for-wordpress/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • gliffy-plugin-for-wordpress/trunk/gliffy-plugin-for-wordpress.php

    r139901 r492434  
    44Plugin URI: http://wiki.gliffy.com/display/APIAPPS/WordPress+Plugin
    55Description: Create diagrams and insert them into your posts or pages!  Look for the "Diagrams" menu when you activate the plugin, and use the Gliffy button on the media bar to insert diagrams. Once activated, make sure to <a href="options-general.php?page=gliffy-config">configure</a> the plugin in the settings menu.
    6 Version: 0.1.3
     6Version: 0.2
    77Author: Gliffy, Inc.
    88Author URI: http://www.gliffy.com/
     
    220220add_filter('media_buttons_context', 'gliffy_button');
    221221
    222 //add_filter('media_upload_tabs', 'gliffy_tab_names');
     222add_filter('media_upload_tabs', 'gliffy_tab_names');
    223223add_action('media_upload_gliffy', 'gliffy_media');
    224224
    225 //
    226225add_action("type_url_form_gliffy", "gliffy_type_url_form");
    227 
    228 //
    229 //add_filter('media_send_to_editor', 'gliffy_media_send_to_editor', 10, 1);
    230 
    231 //    add_action('media_upload_gliffy_new', 'gliffy_tab_new');
    232 
    233 // Disabled the user_menu for now, let's just use the email address of the logged in user
    234 //add_action('admin_menu', 'gliffy_user_menu');
    235226
    236227/**
     
    240231add_filter("authenticate", "gliffy_login", 100, 3);
    241232
    242 //add_action("wp_login", "gliffy_login");
    243 
    244233add_action("wp_logout", "gliffy_logout");
    245234
     
    256245    add_action('admin_menu', 'gliffy_top_menu');
    257246
    258 
    259247    // Registers account specific key value properties
    260248    add_action('admin_init', 'gliffy_register_settings');
    261249
    262 //    add_action('edit_page_form','testMe');
    263 //    add_action('profile_personal_options', 'gliffy_personal');
    264250}
    265251
     
    398384}
    399385
    400 function gliffy_media() {
    401     include "gliffy-wp-popup.php";
    402 }
    403 
    404 //function gliffy_type_url_form() {
    405 ////    echo "Gliffy type url form";
    406 //    error_log("%%%%%%%%%% HELLO WORLD!");
    407 //}
    408 //
    409 //function gliffy_media_upload() {
    410 //
    411 //}
    412 //
    413 //function gliffy_media_send_to_editor($html) {
    414 //    return $html;
    415 //}
     386function gliffy_tab_names($tabs) {
     387    $newtab = array('gliffy' => __('Gliffy Diagram', 'gliffydiagram'));
     388    return array_merge($tabs, $newtab);
     389}
     390
     391function gliffy_media($context) {
     392    include('gliffy-wp-popup.php');
     393}
    416394
    417395function gliffy_options_menu() {
     
    421399function gliffy_top_menu() {
    422400    $image = get_option('siteurl').'/wp-content/plugins/gliffy-plugin-for-wordpress/images/Logo_16x16.png';
    423     //    add_object_page('Diagrams', 'Diagrams', 2, __FILE__, 'gliffy_diagrams_page', $image);
    424     //    add_submenu_page('Diagrams', 'Diagrams', 'Edit', 2, __FILE__, 'gliffy_diagrams_page');
    425401    add_object_page('Diagrams', 'Diagrams', 2, __FILE__, 'gliffy_diagrams_page', $image);
    426402    add_submenu_page(__FILE__, 'Diagrams', 'Edit', 2, __FILE__, 'gliffy_diagrams_page');
    427403    add_submenu_page(__FILE__, 'Diagrams', 'Add New', 2, "gliffy-add", 'gliffy_diagrams_new_page');
    428404}
    429 
    430 //function gliffy_user_menu() {
    431 //    // Adds the Gliffy Profile page under the Users Menu
    432 //    add_submenu_page('users.php', 'Gliffy Profile', 'Gliffy Profile', 2, "gliffy-user", 'gliffy_profile_page');
    433 //}
    434405
    435406function gliffy_register_settings() {
     
    455426}
    456427
    457 /**
    458  * Includes the html page that renders the Users/Gliffy Profile
    459  */
    460 //function gliffy_profile_page() {
    461 //    include('gliffy-wp-profile.php');
    462 //}
    463428
    464429
     
    474439
    475440    while ($macro_begin_index) {
    476 //        echo "macro_begin_index=" , $macro_begin_index , "<br/>";
    477 //        echo "content{" , $content , "}<br/>";
    478 
    479441        $macro_begin_index = strpos($content, $macro_begin);
    480 //        echo "macro_begin_index=" , $macro_begin_index , "<br/>";
     442
    481443
    482444        if ($macro_begin_index) {
    483445            $macro_end_index = strpos($content, $macro_end, $macro_begin_index);
    484 //            echo "macro_end_index=" , $macro_end_index, "<br/>";
     446
    485447
    486448            // Get the whole macro
    487449            $macro = substr($content,  $macro_begin_index, $macro_end_index - $macro_begin_index + $macro_end_len);
    488 //            echo "macro=" , $macro, "<br/>";
    489450            $macro_len = strlen($macro);
    490 //            echo "macro_len=" , $macro_len, "<br/>";
    491451
    492452            // Parse the macro params and pass to function
    493453            $param_begin = $macro_begin_index + $macro_begin_len;
    494 //            echo "tbegin=", $tbegin , "<br/>";
    495454            $param_end = $macro_end_index - $param_begin;
    496 //            echo "tend=", $tend, "<br/>";
    497455
    498456            $csv_parameters = substr($content, $param_begin, $param_end);
    499 //                        echo "csv_parameters=" , $csv_parameters , "<br/>";
    500457            $parameters = strtok($csv_parameters, ",");
    501 //                        echo "parameters=" , $parameters , "<br/>";
    502458
    503459            // todo: parse the parameters into individual tokens
    504460
    505461            $link = gliffy_create_diagram_link($parameters, "L");
    506 //            echo "gliffy_content=" , $gliffy_content, "<br/>";
    507462
    508463            // Replace the macro with our new content
    509464            $content = str_replace($macro, $link, $content);
    510 //            echo "content=" , $content, "<br/>";
    511465        }
    512466    }
  • gliffy-plugin-for-wordpress/trunk/gliffy-wp-diagrams-new.php

    r138961 r492434  
    4343//]]>
    4444</script>
    45 
    46 <?php
    47 
    48 //<div id="TB_overlay" style="
    49 //    position: fixed;
    50 //    z-index:100;
    51 //    top: 0px;
    52 //    left: 0px;
    53 //    height:100%;
    54 //    width:100%;
    55 //    background: url(/wp-includes/js/thickbox/macFFBgHack.png) repeat;
    56 //    ">
    57 //
    58 //    <iframe id="gliffy_editor"
    59 //            frameborder="1"
    60 //            style="
    61 //                position: relative;
    62 //                margin: 30px;
    63 //                height:90%;
    64 //                width:95%;
    65 //            "
    66 //            src="<?php echo $launch_link >"
    67 //            >
    68 //        <p>Your browser does not support iframes.</p>
    69 //    </iframe>
    70 //</div>
    71 ?>
    7245        <iframe id="gliffy_editor"
    7346                frameborder="0"
  • gliffy-plugin-for-wordpress/trunk/gliffy-wp-diagrams.php

    r139007 r492434  
    1010<?php
    1111    try {
     12
    1213        error_log("**** about to get instance");
    1314        $gliffy = gliffy_getinstance();
     
    1516        $diagrams = $gliffy->getDiagrams();
    1617        error_log("**** back from get diagrams");
     18
    1719    }
    1820    catch (GliffyException $e) {
     
    5759
    5860            echo "<tr>";
    59 //            echo "<th class='check-column' scope='row'><input type='checkbox' value='", $diagram->id, "' name='post[]'/>";
    6061            echo "<th class='check-column' scope='row'></th>";
    6162            echo "<td>", $diagram->id, "<br/>";
     
    6970                echo "<span class='view'>$img</span>";
    7071            }
    71             //echo " | <span class='delete'><a href='", gliffy_current_page(), "' title='Delete diagram'>Delete</a></span>";
    7272            echo "</div>";
    7373            echo "</td>";
  • gliffy-plugin-for-wordpress/trunk/gliffy-wp-popup.php

    r138940 r492434  
    9292                <th id="author" class="manage-column column-title" style="" scope="col">Author</th>
    9393                <th id="visibility" class="manage-column column-title" style="" scope="col">Visibility</th>
    94                 <!--<th id="versions" class="manage-column column-title" style="" scope="col"># of Versions</th> -->
    95                 <!--<th id="moddate" class="manage-column column-title" style="" scope="col">Modify Date</th> -->
    9694            </tr>
    9795        </thead>
     
    105103                <th class="manage-column column-title" style="" scope="col">Author</th>
    106104                <th class="manage-column column-title" style="" scope="col">Visibility</th>
    107                 <!--<th class="manage-column column-title" style="" scope="col"># of Versions</th> -->
    108                 <!--<th class="manage-column column-title" style="" scope="col">Modify Date</th> -->
    109105            </tr>
    110106        </tfoot>
     
    115111        foreach( $diagrams as $diagram ) {
    116112            $launch_link = $gliffy->getEditDiagramLink($diagram->id, gliffy_current_page(), 'Back to Wordpress');
    117             //$launch_link = str_replace( 'gliffy-wp-popup.php', 'gliffy-wp-launch.php',  $_SERVER['PHP_SELF'] );
    118             //error_log("**** launch_link=" . $launch_link);
    119113            $returnURL = gliffy_current_page();
    120 //            $launch_link = "/wp-content/plugins/gliffy-wp/gliffy-wp-launch.php?diagram_id=" . $diagram->id . "&return_url=" . $returnURL;
    121 
    122114            echo "<tr>";
    123115            echo "<th scope='row'><input id='$diagram->id' name='diagram' type='radio' onclick='GliffyMacro.setDiagramId($diagram->id);' value='$diagram->id' /></th>";
    124116            echo "<td>", $diagram->id, "<br/>";
    125117            echo "<div class='row-actions'>";
    126 //            echo "<span class='edit'><a href='", $launch_link, "' title='Edit diagram' onclick='growIframe();'>Edit</a></span>";
    127118
    128119            if ($diagram->is_public) {
     
    138129
    139130            error_log("**** IS_PUBLIC=".$diagram->is_public);
    140 //            error_log("**** IS_PRIVATE=".$diagram->is_private);
    141131
    142132            echo "<td>", ($diagram->is_public) ? 'public' : '<span style="color: red;">private</span>', "</td>";
    143 //            echo "<td>", $diagram->num_versions, "</td>";
    144 //            echo "<td>-</td>";
    145133            echo "</tr>";
    146134        }
  • gliffy-plugin-for-wordpress/trunk/lib/src/Gliffy.php

    r138940 r492434  
    505505        $params["launchDiagramId"] = $diagramId;
    506506
    507         if ($returnURL != null) $params["returnURL"] = urlencode($returnURL);
     507        if ($returnURL != null) $params["returnURL"] = $returnURL;
    508508        if ($returnText != null) $params["returnButtonText"] = urlencode($returnText);
    509 
     509   
     510    $params["returnURL"] = str_replace('/gliffy/', '', $params['returnURL']);
    510511        $this->updateToken();
    511512        $theLink = $this->_rest->get($url,"text/xml",$params,true);
  • gliffy-plugin-for-wordpress/trunk/lib/src/config.php

    r138940 r492434  
    1818 * @global string $_GLIFFY_root
    1919 */
    20 $_GLIFFY_root = get_option('gliffy_root');
     20$_GLIFFY_root = "http://www.gliffy.com";
    2121
    2222
  • gliffy-plugin-for-wordpress/trunk/readme.txt

    r382989 r492434  
    33Tags: gliffy, diagram, drawing, draw, flowchart, uml, post, page, plugin, edit
    44Requires at least: 2.8
    5 Tested up to: 3.1.2
    6 Stable tag: 0.1.3
     5Tested up to: 3.3.1
     6Stable tag: 0.2
    77
    88The Gliffy plugin allows you to create diagrams and insert them into your posts or pages. Draw all kinds of diagrams: flowcharts, UI mockups, UML, etc
Note: See TracChangeset for help on using the changeset viewer.