Skip to content

Commit

Permalink
MERGE TO TRUNK
Browse files Browse the repository at this point in the history
bash:~/solar/trunk $ svn merge -r 1736:1841 ../branches/dev
  • Loading branch information
Paul M. Jones committed Sep 24, 2006
1 parent b68524e commit 726d86e
Show file tree
Hide file tree
Showing 150 changed files with 9,944 additions and 2,376 deletions.
379 changes: 45 additions & 334 deletions Solar.php

Large diffs are not rendered by default.

16 changes: 7 additions & 9 deletions Solar/Access/Adapter/File.php
Expand Up @@ -24,18 +24,16 @@
*
* Class for reading access privileges from a text file.
*
* The file format is:
* The file format is ...
*
* 0:flag 1:type 2:name 3:class 4:action 5:submit
* 0:flag 1:type 2:name 3:class 4:action 5:submit
*
* E.g.:
* For example ...
*
* <code>
* deny handle * * * *
* allow role sysadmin * * *
* allow handle + Solar_App_Bookmarks * *
* deny user boshag Solar_App_Bookmarks edit *
* }}
* deny handle * * * *
* allow role sysadmin * * *
* allow handle + Solar_App_Bookmarks * *
* deny user boshag Solar_App_Bookmarks edit *
*
* @category Solar
*
Expand Down
46 changes: 26 additions & 20 deletions Solar/App/Bookmarks.php
Expand Up @@ -41,13 +41,13 @@ class Solar_App_Bookmarks extends Solar_App {
*
* Keys are ...
*
* `area_name`:
* (string) The content area for the bookmarks
* app, default 'Solar_App_Bookmarks'. Will be created automatically
* if it does not exist.
* `area_name`
* : (string) The content area for the bookmarks
* app, default 'Solar_App_Bookmarks'. Will be created automatically
* if it does not exist.
*
* `content`:
* (dependency) A Solar_Content domain model dependency object.
* `content`
* : (dependency) A Solar_Content domain model dependency object.
*
* @var array
*
Expand Down Expand Up @@ -319,15 +319,15 @@ public function actionAdd()
}

// build a link for _redirect() calls and the backlink.
$href = $this->_flash->get('backlink');
$href = $this->_session->getFlash('backlink');
if (! $href) {
// probably browsed to this page directly. link to the user's list.
$uri = Solar::factory('Solar_Uri_Action');
$href = $uri->quick("bookmarks/user/{$this->_user->auth->handle}");
}

// keep the backlink for the next page load
$this->_flash->set('backlink', $href);
$this->_session->setFlash('backlink', $href);

// build the basic form, populated with the bookmark data
// from the database
Expand Down Expand Up @@ -357,7 +357,7 @@ public function actionAdd()
try {

$item->save();
$this->_flash->set('add_ok', true);
$this->_session->setFlash('add_ok', true);
$this->_redirect("bookmarks/edit/{$item->id}");

} catch (Solar_Exception $e) {
Expand Down Expand Up @@ -425,15 +425,15 @@ public function actionEdit($id = null)
// otherwise, return the list for the user.
//

$href = $this->_flash->get('backlink');
$href = $this->_session->getFlash('backlink');
if (! $href) {
// probably browsed directly to this page; return to the user's list
$uri = Solar::factory('Solar_Uri_Action');
$href = $uri->quick("bookmarks/user/{$this->_user->auth->handle}");
}

// keep the backlink for the next page load
$this->_flash->set('backlink', $href);
$this->_session->setFlash('backlink', $href);

// ---------------------------------------------------------------------
//
Expand All @@ -446,7 +446,13 @@ public function actionEdit($id = null)

// now populate the the submitted POST values to the form
$form->populate();


// was this from a quickmark or an add operation?
if ($this->_session->getFlash('add_ok')) {
$form->setStatus(true);
$form->feedback = $this->locale('SUCCESS_ADDED');
}

// Save?
if ($this->_isSubmit('save') && $form->validate()) {

Expand Down Expand Up @@ -533,7 +539,7 @@ public function actionQuick($uri = null, $subj = null)
// if the user *does* already have that URI bookmarked,
// redirect to the existing bookmark.
if (! empty($existing->id)) {
$this->_flash->set('backlink', $uri);
$this->_session->setFlash('backlink', $uri);
$this->_redirect("bookmarks/edit/{$existing['id']}");
}

Expand Down Expand Up @@ -612,11 +618,11 @@ public function actionTag($tags = null)
$total = $this->_bookmarks->countPages($tags, $owner_handle);

// flash forward the backlink in case we go to edit
$this->_flash->set('backlink', Solar::server('REQUEST_URI'));
$this->_session->setFlash('backlink', $this->_request->server('REQUEST_URI'));

// assign everything else for the view
$this->pages = $total['pages'];
$this->order = Solar::get('order', 'created_desc');
$this->order = $this->_request->get('order', 'created_desc');
$this->page = $page;
$this->owner_handle = null; // requested owner_handle
$this->tags = $tags; // the requested tags
Expand All @@ -631,7 +637,7 @@ public function actionTag($tags = null)
$this->layout_link[] = array(
'rel' => 'alternate',
'type' => 'application/rss+xml',
'title' => Solar::server('PATH_INFO'),
'title' => $this->_request->server('PATH_INFO'),
'href' => $uri->fetch(),
);
}
Expand Down Expand Up @@ -698,14 +704,14 @@ public function actionUser($owner_handle = null, $tags = null)
$total = $this->_bookmarks->countPages($tags, $owner_handle);

// flash forward the backlink in case we go to edit
$this->_flash->set('backlink', Solar::server('REQUEST_URI'));
$this->_session->setFlash('backlink', $this->_request->server('REQUEST_URI'));

// set the view
$this->_view = 'browse';

// assign view vars
$this->pages = $total['pages'];
$this->order = Solar::get('order', 'created_desc');
$this->order = $this->_request->get('order', 'created_desc');
$this->page = $page;
$this->owner_handle = $owner_handle; // requested owner_handle
$this->tags = $tags; // the requested tags
Expand All @@ -725,7 +731,7 @@ public function actionUser($owner_handle = null, $tags = null)
$this->layout_link[] = array(
'rel' => 'alternate',
'type' => 'application/rss+xml',
'title' => Solar::server('PATH_INFO'),
'title' => $this->_request->server('PATH_INFO'),
'href' => $uri->fetch(),
);
}
Expand Down
2 changes: 2 additions & 0 deletions Solar/App/Bookmarks/Locale/en_US.php
Expand Up @@ -61,6 +61,8 @@
'ORDER_TAGS' => 'Tags',
'ORDER_TAGS_DESC' => 'Tags (desc)',

'SUCCESS_ADDED' => 'Added new bookmark.',

'BACKLINK' => 'Back',
'CONFIRM_DELETE' => 'Are you sure you want to delete this bookmark?',
'DRAG_THIS' => 'Drag this link to your toolbar for quick bookmarking',
Expand Down
24 changes: 23 additions & 1 deletion Solar/App/Bookmarks/View/edit.php
Expand Up @@ -27,7 +27,7 @@
'onclick' => "return confirm('" . $this->getTextRaw('CONFIRM_DELETE') . "')"
);

echo $this->form()
echo $this->form(array('id' => 'form-bookmark'))
->auto($this->formdata)
->hidden(array('name' => 'submit', 'value' => $this->getTextRaw('SUBMIT_SAVE')))
->beginGroup()
Expand All @@ -36,4 +36,26 @@
->submit(array('name' => 'submit', 'value' => $this->getTextRaw('SUBMIT_DELETE'), 'attribs' => $attribs))
->endGroup()
->fetch();

// add highlighting to all UL elements in the form.
// this works for success and failure, and for all
// individual failed elements.
$this->jsScriptaculous()->effect->highlight(
"#form-bookmark ul.success",
array(
'duration' => 3,
'endcolor' => '#aaaaff',
'restorecolor' => true,
)
);

$this->jsScriptaculous()->effect->highlight(
"#form-bookmark ul.failure",
array(
'duration' => 3,
'endcolor' => '#ffaaaa',
'restorecolor' => true,
)
);

?>
6 changes: 4 additions & 2 deletions Solar/App/Hello/View/rss.php
Expand Up @@ -18,19 +18,21 @@
*/
header('Content-Type: text/xml; charset=iso-8859-1');
echo '<?xml version="1.0" encoding="iso-8859-1" ?>' . "\n";
$request = Solar::factory('Solar_Request');
$server = $request->server();
?>
<rss version="2.0">
<channel>
<title>Solar: Hello World</title>
<link><?php echo $this->escape($_SERVER['REQUEST_URI']) ?></link>
<link><?php echo $this->escape($server['REQUEST_URI']) ?></link>
<description>Example hello world RSS feed</description>
<pubDate><?php echo $this->date('', DATE_RFC822) ?></pubDate>
<item>
<category><?php echo $this->escape($this->code) ?></category>
<title><?php echo $this->escape($this->text) ?></title>
<pubDate><?php echo $this->date(time(), DATE_RFC822) ?></pubDate>
<description><?php echo $this->escape($this->text) ?></description>
<link><?php echo $this->escape($_SERVER['REQUEST_URI']) ?></link>
<link><?php echo $this->escape($server['REQUEST_URI']) ?></link>
</item>
</channel>
</rss>
24 changes: 18 additions & 6 deletions Solar/App/HelloAjax/View/main.php
Expand Up @@ -17,14 +17,22 @@
*
*/
?>
<?php $this->JsPrototype()->event
<?php

$this->JsPrototype()->event
->observe('#top', 'click', 'function() { location.href = "http://solarphp.com"; }')
->observe('#top', 'mouseover', 'function() { this.style.cursor = "pointer"; }')
->observe('#top', 'mouseout', 'function() { this.style.cursor = "auto"; }');?>
->observe('#top', 'mouseout', 'function() { this.style.cursor = "auto"; }');

// sample onclick
$this->JsPrototype()->event->observe('#ahello', 'click', 'function(evt) { alert("hello!"); Event.stop(evt); }');


?>

<p id="hello"><?php echo $this->escape($this->text) ?></p>
<?php $this->jsScriptaculous()->effect->highlight('#hello', array('duration' => 1.0));?>
<?php $this->jsScriptaculous()->control->inPlaceEditor('#hello', 'index.php', array(
<?php $this->JsScriptaculous()->effect->highlight('#hello', array('duration' => 1.0));?>
<?php $this->JsScriptaculous()->control->inPlaceEditor('#hello', 'index.php', array(
'rows' => 15,
'cols' => 40,
'ajaxOptions' => array(
Expand All @@ -34,12 +42,16 @@
'on404' => 'function(t) { alert(\'Error 404: location not found\'); }'
)
));?>

<p><a id="ahello" href="index.php">hello!</a> ... an example of an unobtrusive "onclick" hyperlink.</a></p>


<p><?php echo $this->escape($this->code) ?></p>
<ul>
<?php foreach ($this->list as $code): ?>
<li>
<?php echo $this->action("hello/main/$code", $code) ?>
(<?php echo $this->action("hello/rss/$code", 'RSS') ?>)
<?php echo $this->action("helloajax/main/$code", $code) ?>
(<?php echo $this->action("helloajax/rss/$code", 'RSS') ?>)
</li>
<?php endforeach ?>
</ul>
6 changes: 4 additions & 2 deletions Solar/App/HelloAjax/View/rss.php
Expand Up @@ -18,19 +18,21 @@
*/
header('Content-Type: text/xml; charset=iso-8859-1');
echo '<?xml version="1.0" encoding="iso-8859-1" ?>' . "\n";
$request = Solar::factory('Solar_Request');
$server = $request->server();
?>
<rss version="2.0">
<channel>
<title>Solar: Hello World</title>
<link><?php echo $this->escape($_SERVER['REQUEST_URI']) ?></link>
<link><?php echo $this->escape($server['REQUEST_URI']) ?></link>
<description>Example hello world RSS feed</description>
<pubDate><?php echo $this->date('', DATE_RFC822) ?></pubDate>
<item>
<category><?php echo $this->escape($this->code) ?></category>
<title><?php echo $this->escape($this->text) ?></title>
<pubDate><?php echo $this->date(time(), DATE_RFC822) ?></pubDate>
<description><?php echo $this->escape($this->text) ?></description>
<link><?php echo $this->escape($_SERVER['REQUEST_URI']) ?></link>
<link><?php echo $this->escape($server['REQUEST_URI']) ?></link>
</item>
</channel>
</rss>
4 changes: 4 additions & 0 deletions Solar/App/Layout/_head.php
Expand Up @@ -39,6 +39,10 @@
}
}

// JavaScript Helper-required styles before App styles, so that App styles may
// override bundled style files.
echo $this->js()->fetchStyles();

// styles
if (! empty($this->layout_style)) {
foreach ((array) $this->layout_style as $val) {
Expand Down

0 comments on commit 726d86e

Please sign in to comment.