Permalink
Browse files

Activate Google+ plugin by default

Clear the instance cache on the Dashboard when there isn't one
Style: Clean up dashboard when there's no instance user
Style: Fix Forgot Password and Registration pages
Don't "Hide Settings" when plugin isn't configured
  • Loading branch information...
1 parent ac77cb9 commit ef365e45f67790973d492d62f6f2e7d5b0739a25 @ginatrapani ginatrapani committed Nov 8, 2011
View
@@ -52,6 +52,9 @@ INSERT INTO tu_plugins (name , folder_name, description, author, homepage, versi
VALUES ('Facebook', 'facebook', 'Facebook support', 'Gina Trapani', 'http://thinkupapp.com', '0.01', '1');
INSERT INTO tu_plugins (name , folder_name, description, author, homepage, version, is_active )
+VALUES ('Google+', 'googleplus', 'Google+ support', 'Gina Trapani', 'http://thinkupapp.com', '0.01', '1');
+
+INSERT INTO tu_plugins (name , folder_name, description, author, homepage, version, is_active )
VALUES ('Expand URLs', 'expandurls', 'Expand shortened links.', 'Gina Trapani', 'http://thinkupapp.com', '0.01', '1'); " >> build-db_mysql.sql
@@ -144,7 +144,7 @@ public function testInsertPugin() {
$plugin = $this->createPlugin();
$plugin->name = 'has no home page';
$plugin->homepage = null;
- $this->assertEqual($dao->insertPlugin($plugin), 7);
+ $this->assertEqual($dao->insertPlugin($plugin), 8);
$sql = "select * from " . $this->table_prefix . 'plugins where name = "' . $plugin->name . '"';
$stmt = PluginMySQLDAO::$PDO->query($sql);
$data = $stmt->fetch();
@@ -154,7 +154,7 @@ public function testInsertPugin() {
$plugin = $this->createPlugin(array('is_active' => false));
$plugin->name = 'not active';
$plugin->homepage = null;
- $this->assertEqual($dao->insertPlugin($plugin), 8);
+ $this->assertEqual($dao->insertPlugin($plugin), 9);
$sql = "select * from " . $this->table_prefix . 'plugins where name = "' . $plugin->name . '"';
$stmt = PluginMySQLDAO::$PDO->query($sql);
$data = $stmt->fetch();
@@ -308,7 +308,7 @@ public function testGetPluginId() {
$this->assertEqual($dao->getPluginId('twitter'), 1);
$this->assertEqual($dao->getPluginId('idontexist'), null);
- $this->assertEqual($dao->getPluginId('testpluginact'), 5);
+ $this->assertEqual($dao->getPluginId('testpluginact'), 6);
}
public function testGetPluginFolder() {
@@ -319,7 +319,7 @@ public function testGetPluginFolder() {
$this->assertEqual($dao->getPluginFolder(1), 'twitter');
$this->assertEqual($dao->getPluginFolder(99), null);
- $this->assertEqual($dao->getPluginFolder(5), 'testpluginact');
+ $this->assertEqual($dao->getPluginFolder(6), 'testpluginact');
}
public function testGetAllPlugins() {
@@ -329,9 +329,9 @@ public function testGetAllPlugins() {
$dao = new PluginMySQLDAO();
$plugins = $dao->getAllPlugins();
- $this->assertTrue(count($plugins) == 5);
- $this->assertEqual($plugins[3]->name, "My Test Plugin");
- $this->assertEqual($plugins[3]->folder_name, "testplugin");
+ $this->assertEqual(count($plugins), 6);
+ $this->assertEqual($plugins[4]->name, "My Test Plugin");
+ $this->assertEqual($plugins[4]->folder_name, "testplugin");
// no plugins?
$builders_array = null;
@@ -345,7 +345,7 @@ public function testGetActivePlugins() {
$dao = new PluginMySQLDAO();
$plugins = $dao->getActivePlugins();
- $this->assertEqual(count($plugins), 4);
+ $this->assertEqual(count($plugins), 5);
$this->assertEqual($plugins[0]->name,"Twitter");
$this->assertEqual($plugins[0]->folder_name,"twitter");
@@ -388,15 +388,15 @@ protected function buildData() {
'name' => 'My Test Plugin', 'folder_name' => 'testplugin',
'description' => 'Proof of concept plugin',
'author' => 'Gina Trapani', 'homepage' => 'http://thinkupapp.com',
- 'version' => '0.01', 'is_active' => '0'
+ 'version' => '0.01', 'is_active' => '0'
);
$builder1 = FixtureBuilder::build(self::TEST_TABLE, $plugin1);
$plugin2 = array(
'name' => 'My Test Plugin Activated', 'folder_name' => 'testpluginact',
'description' => 'Proof of concept plugin',
'author' => 'Gina Trapani', 'homepage' => 'http://thinkupapp.com',
- 'version' => '0.01', 'is_active' => '1'
+ 'version' => '0.01', 'is_active' => '1'
);
$builder2 = FixtureBuilder::build(self::TEST_TABLE, $plugin2);
return array($builder1, $builder2);
@@ -188,7 +188,7 @@ public function testSavePluginOption() {
$this->assertEqual($json_response->results->inserted->test1, 3);
$this->assertEqual($json_response->results->inserted->test2, 4);
- $sql = "select * from " . $this->table_prefix . 'options where namespace = \'plugin_options-4\'';
+ $sql = "select * from " . $this->table_prefix . 'options where namespace = \'plugin_options-5\'';
$stmt = $this->pdo->query($sql);
$this->assertEqual($stmt->rowCount(), 3);
for($i = 0; $i < 3; $i++) {
@@ -228,7 +228,7 @@ public function testSavePluginOptionWithWhitespace() {
$this->assertEqual($json_response->results->inserted->test1, 3);
$this->assertEqual($json_response->results->inserted->test2, 4);
- $sql = "select * from " . $this->table_prefix . 'options where namespace = \'plugin_options-4\'';
+ $sql = "select * from " . $this->table_prefix . 'options where namespace = \'plugin_options-5\'';
$stmt = $this->pdo->query($sql);
$this->assertEqual($stmt->rowCount(), 3);
for($i = 0; $i < 3; $i++) {
@@ -287,7 +287,7 @@ public function testUpdatePluginOption() {
$this->assertEqual($json_response->status, 'success');
$this->assertEqual($json_response->results->updated, 2);
- $sql = "select * from " . $this->table_prefix . "options where namespace = 'plugin_options-4'";
+ $sql = "select * from " . $this->table_prefix . "options where namespace = 'plugin_options-5'";
$stmt = $this->pdo->query($sql);
$this->assertEqual($stmt->rowCount(), 3);
for($i = 0; $i < 3; $i++) {
@@ -350,7 +350,7 @@ public function testUpdateDeletePluginOption() {
$this->assertEqual($json_response->status, 'success');
$this->assertEqual($json_response->results->updated, 2);
- $sql = "select * from " . $this->table_prefix . "options where namespace = 'plugin_options-4'";
+ $sql = "select * from " . $this->table_prefix . "options where namespace = 'plugin_options-5'";
$stmt = $this->pdo->query($sql);
$this->assertEqual($stmt->rowCount(), 2);
for($i = 1; $i < 3; $i++) {
@@ -131,16 +131,16 @@ public function testOfUpdateOption() {
}
public function testOfGetOptions() {
- $plugin_builder1 = FixtureBuilder::build('plugins', array('id'=>'4', 'folder_name'=>'test_plugin'));
- $plugin_builder2 = FixtureBuilder::build('plugins', array('id'=>'5', 'folder_name'=>'test_plugin1'));
+ $plugin_builder1 = FixtureBuilder::build('plugins', array('id'=>'5', 'folder_name'=>'test_plugin'));
+ $plugin_builder2 = FixtureBuilder::build('plugins', array('id'=>'6', 'folder_name'=>'test_plugin1'));
# init our dao
$dao = new PluginOptionMySQLDAO();
$builder1 = $this->buildOptions(1, 'test name', 'test option');
$insert_id1 = $builder1->columns[ 'last_insert_id' ];
- $builder2 = $this->buildOptions(4, 'test name2', 'test option2');
+ $builder2 = $this->buildOptions(5, 'test name2', 'test option2');
$insert_id2 = $builder2->columns[ 'last_insert_id' ];
- $builder3 = $this->buildOptions(4, 'test name3', 'test option3');
+ $builder3 = $this->buildOptions(5, 'test name3', 'test option3');
$insert_id3 = $builder3->columns[ 'last_insert_id' ];
// bad plugin id
@@ -159,10 +159,10 @@ public function testOfGetOptions() {
$this->assertNotNull( $options );
$this->assertEqual(count($options), 2);
$this->assertIsA($options[0], 'PluginOption');
- $this->assertEqual($options[0]->plugin_id, 4);
+ $this->assertEqual($options[0]->plugin_id, 5);
$this->assertEqual($options[0]->id, 3);
$this->assertIsA($options[1], 'PluginOption');
- $this->assertEqual($options[1]->plugin_id, 4);
+ $this->assertEqual($options[1]->plugin_id, 5);
$this->assertEqual($options[1]->id, 4);
}
@@ -56,14 +56,14 @@ public function testGetCounts() {
if($table['table'] == $this->table_prefix . 'options') {
$this->assertEqual($table['count'], 1);
} else if($table['table'] == $this->table_prefix . 'plugins') {
- $this->assertEqual($table['count'], 3);
+ $this->assertEqual($table['count'], 4);
} else {
$this->assertEqual($table['count'], 0);
}
}
// are we sorted by count desc?
- $this->assertEqual(3,$counts[0]['count']);
+ $this->assertEqual(4,$counts[0]['count']);
$this->assertEqual(1,$counts[1]['count']);
$this->assertEqual(0,$counts[2]['count']);
}
@@ -71,6 +71,7 @@ public function control() {
}
}
}
+ $add_user_buttons = array_reverse($add_user_buttons);
$this->addToView('add_user_buttons', $add_user_buttons);
}
}
@@ -173,6 +174,9 @@ private function setInstance() {
}
$this->addToView('instance', $this->instance);
+ } else {
+ SessionCache::put('selected_instance_network', null);
+ SessionCache::put('selected_instance_username', null);
}
$this->addToView('developer_log', $config->getValue('is_log_verbose'));
}
@@ -20,10 +20,11 @@ function show_settings() {
{/literal}
</script>
+{if $is_configured}
<p>
<a href="#" onclick="show_settings(); return false"><img id="settings-icon" src="{$site_root_path}assets/img/slickgrid/actions.gif" /> <span id="settings-flip-prompt">Show</span> Settings</a>
-<br><br>
</p>
-
+{/if}
+<br><br>
<div class="plugin-settings">
<h2 class="subhead">Settings</h2>
@@ -6,8 +6,8 @@
<!-- begin left nav -->
<div class="grid_4 alpha omega">
+ {if $instance}
<div id="nav">
- {if $instance}
<ul id="top-level-sidenav">
{/if}
{if $instance}
@@ -26,10 +26,10 @@
{/foreach}
{/if}
- {if $instance}
+ {if $instance}
</ul>
- {/if}
</div>
+ {/if}
</div>
<div class="thinkup-canvas round-all grid_20 alpha omega prepend_20 append_20" style="min-height:340px">
@@ -247,16 +247,16 @@
{if !$instance}
<div style="width:60%;text-align:center;">
{if $add_user_buttons}
+ <br ><br>
{foreach from=$add_user_buttons key=smkey item=button name=smenuloop}
- <br><br>
- <div style="float:right;"><a href="{$site_root_path}account/?p={$button}" class="linkbutton emphasized">Add a {if $button eq 'googleplus'}Google+{else}{$button|ucwords}{/if} Account</a></div>
+ <div style="float:right;padding:5px;"><a href="{$site_root_path}account/?p={$button}" class="linkbutton emphasized">Add a {if $button eq 'googleplus'}Google+{else}{$button|ucwords}{/if} Account &rarr;</a></div>
+ <div style="clear:both;">&nbsp;</div>
{/foreach}
{/if}
- <br><br>
{if $logged_in_user}
- <div style="float:right;"><a href="{$site_root_path}account/" class="linkbutton emphasized">Adjust Your Settings</a></div>
+ <div style="float:right;padding:5px;"><a href="{$site_root_path}account/" class="linkbutton emphasized">Adjust Your Settings</a></div>
{else}
- <div style="float:right;"><a href="{$site_root_path}session/login.php" class="linkbutton emphasized">Log In</a></div>
+ <div style="float:right;padding:5px;"><a href="{$site_root_path}session/login.php" class="linkbutton emphasized">Log In</a></div>
{/if}
</div>
{/if}
@@ -1,32 +1,31 @@
{include file="_header.tpl"}
{include file="_statusbar.tpl"}
-<div class="container_24 thinkup-canvas round-all">
- <div class="help-container">{insert name="help_link" id='forgot'}</div>
- <div class="prepend_20" style="padding:20px">
- <h1>Reset Your Password</h1>
- </div>
- <div class="clearfix prepend_20">
- <div class="grid_17 prefix_3 left">
+<div class="container_24 thinkup-canvas round-all clearfix" style="margin-top : 30px;">
+
{if isset($error_msgs)}
- <div class="error">
+ <div class="grid_18 alert urgent" style="margin-bottom : 20px; margin-left : 100px;">
{$error_msg}
</div>
{/if}
{if isset($success_msg)}
- <div class="ui-state-success ui-corner-all" style="margin: 20px 0px; padding: 0.5em 0.7em;">
+ <div class="grid_18 alert helpful" style="margin-bottom : 20px; margin-left : 100px;">
<p>
<span class="ui-icon ui-icon-check" style="float: left; margin:.3em 0.3em 0 0;"></span>
{$success_msg}
</p>
</div>
{/if}
- </div>
- </div>
- <div class="clearfix append_20">
- <form name="form1" method="post" action="" class="login">
+
+<div class="grid_18 section" style="margin-bottom : 100px; margin-left : 100px;">
+ {insert name="help_link" id='forgot'}
+
+ <h2>Reset Your Password</h2>
+
+ <div class="article">
+ <form name="form1" method="post" action="" class="login append_20">
<div class="clearfix">
- <div class="grid_4 prefix_5 right">
+ <div class="grid_4 prefix_2 right">
<label for="email">
Email:
</label>
@@ -36,16 +35,18 @@
</div>
</div>
<div class="clearfix">
- <div class="grid_10 prefix_9 left">
- <input type="submit" id="login-save" name="Submit" class="tt-button ui-state-default ui-priority-secondary ui-corner-all" value="Send Reset">
+ <div class="grid_10 prefix_7 left">
+ <input type="submit" id="login-save" name="Submit" class="linkbutton emphasized" value="Send Reset">
</div>
</div>
</form>
- <div class="center prepend_20 append_20">
+ </div>
+ <div class="view-all">
<a href="register.php">Register</a> |
<a href="login.php">Log In</a>
</div>
- </div>
+
+</div>
</div>
-{include file="_footer.tpl"}
+{include file="_footer.tpl"}
Oops, something went wrong.

0 comments on commit ef365e4

Please sign in to comment.