Skip to content

Commit

Permalink
change css & jquery to allow for multiple columns & add add if/else s…
Browse files Browse the repository at this point in the history
…tatement for full_screen theme
  • Loading branch information
CharlieMarshall committed May 27, 2013
1 parent 03a035d commit 93916e3
Showing 1 changed file with 34 additions and 14 deletions.
48 changes: 34 additions & 14 deletions usr/local/www/index.php
Expand Up @@ -471,7 +471,7 @@ function changeTabDIV(selectedDiv){

<script type="text/javascript">
//<![CDATA[
columns = ['col1','col2'];
columns = ['col1','col2','col3','col4', 'col5','col6','col7','col8','col9','col10'];
//]]>
</script>

Expand Down Expand Up @@ -559,7 +559,7 @@ function changeTabDIV(selectedDiv){
$printed = false;
$firstprint = false;
?>
<div id="col1" style="float:left;width:49%;padding-bottom:40px">
<div id="col1" style="float:left;width:49%;padding-bottom:40px" class="ui-sortable">
<?php

foreach($widgetlist as $widget) {
Expand Down Expand Up @@ -636,22 +636,42 @@ function changeTabDIV(selectedDiv){
}
}

if ($config['widgets'] && $pconfig['sequence'] != ""){
if ($colpos[$widgetcounter] == "col2" && $printed == false)
{
if($g['theme'] != "full_screen") {
if ($config['widgets'] && $pconfig['sequence'] != ""){
if ($colpos[$widgetcounter] == "col2" && $printed == false)
{
$printed = true;
?>
</div>
<div id="col2" style="float:right;width:49%;padding-bottom:40px" class="ui-sortable">
<?php
}
}
else if ($widgetcounter >= $halftotal && $printed == false){
$printed = true;
?>
</div>
<div id="col2" style="float:right;width:49%;padding-bottom:40px">
<div id="col2" style="float:right;width:49%;padding-bottom:40px" class="ui-sortable">
<?php
}
}
else if ($widgetcounter >= $halftotal && $printed == false){
$printed = true;
?>
</div>
<div id="col2" style="float:right;width:49%;padding-bottom:40px">
<?php
else {
if ($config['widgets'] && $pconfig['sequence'] != "") {
if ($colpos[$widgetcounter] == "col2" && $printed == false)
{
$printed = true;
?>
</div>
<div id="col2" style="float:right;width:49%;padding-bottom:40px" class="ui-sortable">
<?php
}
else { ?>
<script language="javascript" type="text/javascript">
var colpos = "<?=$colpos[$widgetcounter]?>";
createColumn(colpos);
</script>
<?php }
}
}

?>
Expand Down Expand Up @@ -726,8 +746,7 @@ function changeTabDIV(selectedDiv){
//<![CDATA[
jQuery(document).ready(function(in_event)
{
jQuery('#col1').sortable({connectWith: '#col2', dropOnEmpty: true, handle: '.widgetheader', change: showSave});
jQuery('#col2').sortable({connectWith: '#col1', dropOnEmpty: true, handle: '.widgetheader', change: showSave});
jQuery('.ui-sortable').sortable({connectWith: '.ui-sortable', dropOnEmpty: true, handle: '.widgetheader', change: showSave});

<?php if (!$config['widgets'] && $pconfig['sequence'] != ""){ ?>
hideAllWidgets();
Expand All @@ -754,3 +773,4 @@ function changeTabDIV(selectedDiv){

</body>
</html>

1 comment on commit 93916e3

@CharlieMarshall
Copy link
Owner Author

Choose a reason for hiding this comment

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

  • Changed the css to use their existing class names instead of their ids (does not affect existing code)

  • Changed the jQuery to use the columns existing class names instead of their ids (does not affect existing code)

  • Added 8 additional columns (does not affect existing code, these will just be ignored)

  • Added an if / else statement around the widget code:

    if($g['theme'] != "full_screen") {
    // do existing code
    }
    else {
    // do modified with additional columns
    }
    
  • Indentation

Please sign in to comment.