Skip to content

Commit

Permalink
svn changes
Browse files Browse the repository at this point in the history
  • Loading branch information
voitto committed May 18, 2009
1 parent 4df1ccb commit 3677650
Show file tree
Hide file tree
Showing 9 changed files with 139 additions and 202 deletions.
42 changes: 39 additions & 3 deletions app/omb/controllers/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,51 @@ function index( &$vars ) {
extract( $vars );

$aktwitter_tw_text_options = array(
'false'=>'false',
'true'=>'true'
'0'=>'false',
'1'=>'true'
);

$Setting =& $db->model('Setting');

$threadmode = $Setting->find_by(array('name'=>'config.env.threaded','profile_id'=>get_profile_id()));
if (!$threadmode) {
$threadmode = $Setting->base();
$threadmode->set_value('profile_id',get_profile_id());
$threadmode->set_value('person_id',get_person_id());
$threadmode->set_value('name','config.env.threaded');
$threadmode->set_value('value',1);
$threadmode->save_changes();
$threadmode->set_etag();
$threadmode = $Setting->find($threadmode->id);
}
$threadurl = $request->url_for(array('resource'=>'settings','id'=>$threadmode->id,'action'=>'put'));
$threadentry = $threadmode->FirstChild('entries');

$catmode = $Setting->find_by(array('name'=>'config.env.categories','profile_id'=>get_profile_id()));
if (!$catmode) {
$catmode = $Setting->base();
$catmode->set_value('profile_id',get_profile_id());
$catmode->set_value('person_id',get_person_id());
$catmode->set_value('name','config.env.categories');
$catmode->set_value('value',0);
$catmode->save_changes();
$catmode->set_etag();
$catmode = $Setting->find($catmode->id);
}
$caturl = $request->url_for(array('resource'=>'settings','id'=>$catmode->id,'action'=>'put'));
$catentry = $catmode->FirstChild('entries');

return vars(
array(
&$collection,
&$aktwitter_tw_text_options,
&$profile
&$profile,
&$threadmode,
&$threadurl,
&$threadentry,
&$catmode,
&$caturl,
&$catentry
),
get_defined_vars()
);
Expand Down
6 changes: 2 additions & 4 deletions app/omb/plugins/wp.php
Original file line number Diff line number Diff line change
Expand Up @@ -2013,6 +2013,7 @@ function dynamic_sidebar() {
global $sidebar_done;

if (isset($request->params['nickname'])) {

if ($request->action == 'index' && $request->byid == get_profile_id())
render_partial('apps');
echo '<script type="text/javascript" src="'.$request->url_for(array('resource'=>'pages','action'=>'block.js')).'"></script>';
Expand All @@ -2027,11 +2028,8 @@ function dynamic_sidebar() {
return true;
}

// toggle this on/off to use the blocks
$use_sidebar_blocks = false;

$blocks = environment('blocks');
if ($use_sidebar_blocks && !empty($blocks) && !$sidebar_done) {
if (environment('categories') && !empty($blocks) && !$sidebar_done && $request->resource == 'posts') {
foreach ($blocks as $b) {
// if it's the prologue theme, don't show PAGES in sidebar
if (!($b == 'pages' && environment('theme') == 'prologue-theme')){
Expand Down
156 changes: 90 additions & 66 deletions app/omb/views/admin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,91 +64,115 @@
<script type="text/javascript">
// <![CDATA[

<?php

global $db;

$Setting =& $db->model('Setting');

$threadmode = $Setting->find_by(array('name'=>'config.env.threaded','profile_id'=>get_profile_id()));

if (!$threadmode) {
$threadmode = $Setting->base();
$threadmode->set_value('profile_id',get_profile_id());
$threadmode->set_value('person_id',get_person_id());
$threadmode->set_value('name','config.env.threaded');
$threadmode->set_value('value','false');
$threadmode->save_changes();
$threadmode->set_etag();
$threadmode = $Setting->find($threadmode->id);
}
$seturl = $request->url_for(array('resource'=>'settings','id'=>$threadmode->id,'action'=>'put'));

$threadentry = $threadmode->FirstChild('entries');

?>

$(document).ready(function() {

var submit_to = "<?php url_for(array(
'resource'=>'settings',
'id'=>$threadmode->id,
'action'=>'put'
)); ?>";
var submit_to = "<?php url_for(array(
'resource'=>'settings',
'id'=>$threadmode->id,
'action'=>'put'
)); ?>";

var submit_to = "<?php echo $threadurl; ?>";

$(".editable_select_tw_text").mouseover(function() {
$(this).highlightFade({end:'#def'});
});
$(".editable_select_tw_text").mouseout(function() {
$(this).highlightFade({end:'#fff', speed:200});
});
$(".editable_select_tw_text").editable(submit_to, {
indicator : "<img src='<?php base_path(); ?>resource/jeditable/indicator.gif'>",
data : '<?php if (!class_exists("Services_JSON")) lib_include("json"); $json = new Services_JSON(); echo $json->encode( $aktwitter_tw_text_options ); ?>',
submitdata : function() {
return {"entry[etag]" : "<?php echo $threadentry->etag; ?>"};
},
name : "setting[value]",
type : "select",
placeholder : "<?php echo $threadmode->value; ?>",
noappend : "true",
submit : "OK",
tooltip : "Click to edit...",
cancel : "Cancel",
callback : function(value, settings) {
$(this).html(settings['jsonarr'][value-0]);
return(value);
}
});


var submit_to = "<?php echo $seturl; ?>";

$(".editable_select_tw_text").mouseover(function() {
$(this).highlightFade({end:'#def'});
});
$(".editable_select_tw_text").mouseout(function() {
$(this).highlightFade({end:'#fff', speed:200});
});
$(".editable_select_tw_text").editable(submit_to, {
indicator : "<img src='<?php base_path(); ?>resource/jeditable/indicator.gif'>",
data : '<?php if (!class_exists("Services_JSON")) lib_include("json"); $json = new Services_JSON(); echo $json->encode( $aktwitter_tw_text_options ); ?>',
submitdata : function() {
return {"entry[etag]" : "<?php echo $threadentry->etag; ?>"};
},
name : "setting[value]",
type : "select",
placeholder : "<?php echo $threadmode->value; ?>",
noappend : "true",
submit : "OK",
tooltip : "Click to edit...",
cancel : "Cancel",
callback : function(value, settings) {
$(this).html(settings['jsonarr'][value-0]);
return(value);
}
});
var submit_to = "<?php url_for(array(
'resource'=>'settings',
'id'=>$catmode->id,
'action'=>'put'
)); ?>";

var submit_to = "<?php echo $caturl; ?>";

$(".editable_select_cat_text").mouseover(function() {
$(this).highlightFade({end:'#def'});
});
$(".editable_select_cat_text").mouseout(function() {
$(this).highlightFade({end:'#fff', speed:200});
});
$(".editable_select_cat_text").editable(submit_to, {
indicator : "<img src='<?php base_path(); ?>resource/jeditable/indicator.gif'>",
data : '<?php if (!class_exists("Services_JSON")) lib_include("json"); $json = new Services_JSON(); echo $json->encode( $aktwitter_tw_text_options ); ?>',
submitdata : function() {
return {"entry[etag]" : "<?php echo $catentry->etag; ?>"};
},
name : "setting[value]",
type : "select",
placeholder : "<?php echo $catmode->value; ?>",
noappend : "true",
submit : "OK",
tooltip : "Click to edit...",
cancel : "Cancel",
callback : function(value, settings) {
$(this).html(settings['jsonarr'][value-0]);
return(value);
}
});



});
// ]]>
</script>


<table cellpadding="10" border="0">



<div id="tabs-1">
<p>
OpenMicroBlogger Administration Tools
</p>
<p>
<table cellpadding="10" border="0">
<tr>
<td>
<h3>Threaded:</h3>
<h4>Tags:</h4>
</td>
<td>
<div class="editable_select_cat_text" id="editable_select_cat_text"></div>
</td>
</tr>
<tr>
<td>
<h4>Threaded:</h4>
</td>
<td>
<div class="editable_select_tw_text" id="editable_select_tw_text"></div>
</td>
</tr>

</table>



<div id="tabs-1">
<p>
OpenMicroBlogger Administration Tools
</p>
<ul>
<li><a href="<?php url_for(array('resource'=>'migrate')); ?>">Update Database</a></li>
</ul>
<ul>
<li><a href="<?php url_for(array('resource'=>'groups')); ?>">Rest API Permissions</a></li>
<ul style="list-style:none;">
<li style="padding:5px;"><a href="<?php url_for(array('resource'=>'migrate')); ?>">Update Database</a></li>
<li style="padding:5px;"><a href="<?php url_for(array('resource'=>'groups')); ?>">Rest API Permissions</a></li>
</ul>
</div>

Expand Down
29 changes: 0 additions & 29 deletions app/omb/views/identities/_pass.html

This file was deleted.

2 changes: 1 addition & 1 deletion db/library/dbscript/_functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2648,7 +2648,7 @@ function pretty_urls() {

function setting($name) {
if (!signed_in())
return;
return false;
global $db;
global $ombsettings;
if (!is_array($ombsettings))
Expand Down
97 changes: 0 additions & 97 deletions db/library/twitter-lib.php

This file was deleted.

1 comment on commit 3677650

@Shen
Copy link
Collaborator

@Shen Shen commented on 3677650 May 18, 2009

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOT SAFE!!
I am able to go to /admin without beeing logged in as admin.

Please sign in to comment.