예제 #1
0
function autoclose_tag_cleanup(&$sample_html, $offset, $tags_raw, $nested, $close)
{
    $tags = mk_open_tag_regexp($tags_raw);
    skip_to($sample_html, $offset, $tags_raw);
    while (preg_match("#^(.*?)({$tags})#is", substr($sample_html, $offset), $matches)) {
        // convert tag name found to lower case
        $tag = strtolower($matches[3]);
        // calculate position of the tag found
        $tag_start = $offset + strlen($matches[1]);
        $tag_end = $tag_start + strlen($matches[2]);
        if ($tag == $close) {
            return $tag_end;
        }
        // REQ: PHP 4.0.5
        if (isset($nested[$tag])) {
            $offset = $nested[$tag]($sample_html, $tag_end);
        } else {
            $to_be_inserted = "<" . $close . ">";
            $sample_html = substr_replace($sample_html, $to_be_inserted, $tag_start, 0);
            return $tag_start + strlen($to_be_inserted);
        }
        skip_to($sample_html, $offset, $tags_raw);
    }
    return $offset;
}
예제 #2
0
파일: steps.php 프로젝트: Swift-Jr/thmdhc
function display_step($Step, $ShowToTop = false, $AllSteps = array())
{
    ?>
        <li class="row custom-line" ifx-ie-url="/site-admin/custom/edit_step/<?php 
    echo $Step->id();
    ?>
/">
            <div class="col-xs-9">
                <div class="row">
                    <div class="col-xs-8">
                        <span class="mini-heading">Heading</span>
                        <h3 ifx-inline-edit name="title"><?php 
    echo $Step->title;
    ?>
</h3>
                    </div>
                    <div class="col-xs-4">
                        <span class="mini-heading">Short Title</span>
                        <h3 ifx-inline-edit name="short_title"><?php 
    echo $Step->short_title;
    ?>
</h3>
                    </div>
                </div>
                <span class="mini-heading">Description</span>
                <p ifx-inline-edit ifx-ie-textarea name="description"><?php 
    echo $Step->description;
    ?>
</p>
                <div class="row">
                    <div class="col-xs-4">
                        <span class="mini-heading">Hide Prices</span>
                        <p ifx-inline-edit ifx-ie-select='<?php 
    echo json_encode(array('No', 'Yes'));
    ?>
' name="no_prices"><?php 
    echo $Step->no_prices ? 'Yes' : 'No';
    ?>
</p>
                    </div>
                    <div class="col-xs-4">
                        <span class="mini-heading">Next Step</span>
                        <p ifx-inline-edit ifx-ie-select='<?php 
    echo $AllSteps;
    ?>
' name="next_step" placeholder="End of Process"><?php 
    echo $Step->next_step->short_title;
    ?>
</p>
                    </div>
                    <div class="col-xs-4">
                        <span class="mini-heading">Skip to</span>
                        <p ifx-inline-edit ifx-ie-select='<?php 
    echo $AllSteps;
    ?>
' name="skip_to" placeholder="None"><?php 
    echo skip_to($Step);
    ?>
</p>
                    </div>
                </div>
            </div>
            <div class="col-xs-3 actions">
                <?php 
    if ($ShowToTop) {
        ?>
<a href="/site-admin/custom/make_first/<?php 
        echo $Step->id();
        ?>
"><i class="fa fa-arrow-up" title="make first"></i></a><?php 
    }
    ?>
                <a href="/site-admin/custom/options/<?php 
    echo $Step->id();
    ?>
" title="View Options"><i class="fa fa-bars"></i></a>
                <a confirm-href="/site-admin/custom/delete_step/<?php 
    echo $Step->id();
    ?>
"><i class="fa fa-remove"></i></a>
            </div>
        </li>
        <?php 
}