Exemple #1
0
function showFav($sort_a) {

$MMCApp =& MMCApp::getInstance();


foreach(getSorted($MMCApp->getModules()) as $mkey => $mod) {
    if (!$sort_a[$mod->getName()]) {
        continue;
    }
    if ($mod->getName()==$_GET['lmodule']) {
        $style="_select";
    } else {
        $style="";
    }
    print "<div class=\"modulefav$style\"><h3>".$mod->getDescription()."</h3>";
    foreach($sort_a[$mod->getName()] as $key => $al) {
        $submod = $mod->getSubmod($key);
        if ($mod->getName()==$_GET['lmodule']) {
            if ($submod->getName()==$_GET['lsubmod']) {
                $style="_sselect";
            } else {
                $style="_select";
            }
        } else {
            $style="";
        }


        print "<div class=\"submodfav$style\"><h4>".$submod->getDescription()."</h4>";
        foreach($al as $akey => $value) {
            $uri = $mod->getName().'/'.$key.'/'.$akey;

            $getrecop = $_GET;
            $getrecop['fav_action']='del';

            $getrecop['uri']=$uri;
            ?> <span class="redbutton"><a href="#" onClick="new Ajax.Updater('__popup_container','<?php echo  urlStr('base/main/favorites',$getrecop); ?>'); return false">X</a></span> <?



            $page = getPage($uri);
            if ($page) {
                print '<a href="'.urlStr($uri).'">'.$page->getDescription().'</a>';
            } else {
                print $uri;
            }
            ?>
            <br/>

        <?
        }
    print '</div>';
    }
    print '</div>';
}
}
Exemple #2
0
function display_mod($mod)
{
    if (!$mod->hasVisible()) {
        return;
    }
    ?>
    <div class="module" id="<?php 
    echo $mod->getName();
    ?>
">
        <h3 class="handle"><?php 
    echo $mod->getDescription();
    ?>
</h3>
        <?php 
    foreach (getSorted($mod->getSubmodules()) as $submod) {
        display_submod($submod, $mod);
    }
    ?>
    </div>
<?php 
}
Exemple #3
0
function display_mod($mod)
{
    if (!$mod->hasVisible()) {
        return;
    }
    global $i;
    ?>
    <div class="column" id="col<?php 
    echo $i;
    ?>
" style="width:250px;">
                <div id="<?php 
    echo $mod->getName();
    ?>
" class="portlet">
                    <div class="portlet-header"><?php 
    echo $mod->getDescription();
    ?>
</div>
                    <div class="portlet-content">
    <?php 
    foreach (getSorted($mod->getSubmodules()) as $submod) {
        ?>

                    <?php 
        display_submod($submod, $mod);
        $i++;
        ?>
    <?php 
    }
    ?>
            </div>
        </div>
    </div>
<?php 
}
                //block date
                $thisDate = $data[0][1];
                if (isOlder($myDate, $thisDate)) {
                    $goodIndex = $iLoc;
                    break;
                }
            }
            if ($goodIndex == -1) {
                //we have the earliest block so far, attach to the end
                $output[$index][$sizeSoFar] = $outBlok;
            } else {
                //attend on $goodIndex
                //make space first
                for ($i = $sizeSoFar - 1; $i >= $goodIndex; $i--) {
                    $output[$index][$i + 1] = $output[$index][$i];
                }
                $output[$index][$goodIndex] = $outBlok;
            }
        } else {
            //add new chat group
            $names[] = $people;
            $output[][0] = $people;
            $output[count($output) - 1][1] = $outBlok;
        }
    }
    return array($names, $output);
}
$content = file_get_contents('people.txt');
$data = getSorted($content);
//save to file
file_put_contents("data.json", json_encode($data));